COOPENOMICS  v1
Кооперативная Экономика
shared_ledger.hpp
См. документацию.
1#pragma once
2
11 struct [[eosio::table, eosio::contract(LEDGER)]] laccount {
12 uint64_t id;
13 std::string name;
14 eosio::asset available;
15 eosio::asset blocked;
16 eosio::asset writeoff;
17
18 uint64_t primary_key() const { return id; }
19
23 bool is_empty() const {
24 return available.amount == 0 && blocked.amount == 0 && writeoff.amount == 0;
25 }
26
30 eosio::asset get_total() const {
31 return available + blocked + writeoff;
32 }
33
37 eosio::asset get_balance() const {
38 return available + blocked;
39 }
40};
41
45typedef eosio::multi_index<"accounts"_n, laccount> laccounts_index;
46
55struct [[eosio::table, eosio::contract(LEDGER)]] writeoff_op {
56 uint64_t id;
57 eosio::name coopname;
58 eosio::name username;
59 uint64_t account_id;
60 eosio::asset quantity;
61 std::string reason;
63 checksum256 writeoff_hash;
64 eosio::name status;
65
66 uint64_t primary_key() const { return id; }
67 uint64_t by_coop() const { return coopname.value; }
68 checksum256 by_hash() const { return writeoff_hash; }
69};
70
71typedef eosio::multi_index<"writeoffs"_n, writeoff_op,
72 eosio::indexed_by<"bycoop"_n, eosio::const_mem_fun<writeoff_op, uint64_t, &writeoff_op::by_coop>>,
73 eosio::indexed_by<"byhash"_n, eosio::const_mem_fun<writeoff_op, checksum256, &writeoff_op::by_hash>>
75
76
80class Ledger {
81public:
82
86 static const std::set<eosio::name> ledger_actions;
87
91 static eosio::name get_valid_ledger_action(const eosio::name& action);
92
96 static void check_ledger_symbol(const eosio::asset& amount);
97
101 static void check_positive_amount(const eosio::asset& amount);
102
103 // Основные операции
104 static void add(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment);
105 static void sub(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment);
106 static void transfer(eosio::name actor, eosio::name coopname, uint64_t from_account_id, uint64_t to_account_id, eosio::asset quantity, std::string comment);
107
108 // Операции блокировки/разблокировки
109 static void block(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment);
110 static void unblock(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment);
111
112 // Атомарные операции списания
113 static void writeoff(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment);
114 static void writeoffcnsl(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment);
115
116 // Специализированные методы для членских взносов
117 static void add_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment);
118 static void sub_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment);
119 static void block_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment);
120 static void unblock_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment);
121
125 static std::optional<writeoff_op> get_writeoff_by_hash(const checksum256 &writeoff_hash);
126
130 static std::string get_account_name_by_id(uint64_t account_id);
131
138 struct accounts {
139 // Денежные средства
140 static constexpr uint64_t CASH = 50;
141 static constexpr uint64_t BANK_ACCOUNT = 51;
142
143 // Расчеты с пайщиками
144 static constexpr uint64_t MEMBER_SETTLEMENTS = 75;
145 static constexpr uint64_t MEMBER_DEBT = 751;
146 static constexpr uint64_t INCOME_ACCRUALS = 752;
147
148 // Паевой фонд
149 static constexpr uint64_t SHARE_FUND = 80;
150
151 // Расчеты с пайщиками (дебиторами и кредиторами)
152 static constexpr uint64_t MEMBER_FEES = 761;
153 static constexpr uint64_t PROPERTY_TRANSFER = 762;
154 static constexpr uint64_t OTHER_SETTLEMENTS = 763;
155
156 // Расчеты по займам
157 static constexpr uint64_t LOANS_ISSUED = 583;
158 static constexpr uint64_t LOAN_INTEREST = 911;
159
160 // Финансовые вложения из средств ПО
161 static constexpr uint64_t FINANCIAL_INVESTMENTS = 58;
162 static constexpr uint64_t SHARES_AND_STAKES = 581;
163 static constexpr uint64_t SECURITIES = 582;
164
165 // Расчеты с дебиторами и кредиторами
166 static constexpr uint64_t DEBTORS_CREDITORS = 76;
167
168 // Запасы, затраты, расчеты, собственные средства
169 static constexpr uint64_t FIXED_ASSETS = 1;
170 static constexpr uint64_t INTANGIBLE_ASSETS = 4;
171 static constexpr uint64_t MATERIALS_GOODS = 10;
172 static constexpr uint64_t MAIN_PRODUCTION = 20;
173 static constexpr uint64_t NON_PROFIT_ACTIVITY = 201;
174 static constexpr uint64_t GENERAL_EXPENSES = 26;
175 static constexpr uint64_t RESERVES = 63;
176 static constexpr uint64_t LONG_TERM_LOANS = 67;
177 static constexpr uint64_t TAXES_FEES = 68;
178 static constexpr uint64_t SOCIAL_INSURANCE = 69;
179 static constexpr uint64_t SALARY = 70;
180 static constexpr uint64_t ACCOUNTABLE_PERSONS = 71;
181 static constexpr uint64_t ADDITIONAL_CAPITAL = 83;
182 static constexpr uint64_t FUNDS_PO_1 = 831;
183 static constexpr uint64_t CURRENT_YEAR_PROFIT = 841;
184 static constexpr uint64_t PREVIOUS_YEARS_PROFIT = 842;
185 static constexpr uint64_t FUNDS_PO_2 = 843;
186 static constexpr uint64_t UNDISTRIBUTED_PROFIT = 84;
187 static constexpr uint64_t TARGET_RECEIPTS = 86;
188 static constexpr uint64_t ENTRANCE_FEES = 861;
189 static constexpr uint64_t RESERVE_FUND = 862;
190 static constexpr uint64_t INDIVISIBLE_FUND = 863;
191 static constexpr uint64_t ECONOMIC_ACTIVITY_FUND = 864;
192 static constexpr uint64_t MUTUAL_SECURITY_FUND = 865;
193 static constexpr uint64_t DEVELOPMENT_FUND = 866;
194 static constexpr uint64_t OTHER_INCOME_EXPENSES = 91;
195 static constexpr uint64_t FUTURE_EXPENSES_RESERVE = 96;
196 static constexpr uint64_t FUTURE_INCOME = 98;
197 static constexpr uint64_t FREE_RECEIPT = 981;
198 };
199};
200
208static const std::vector<std::tuple<uint64_t, std::string>> ACCOUNT_MAP = {
209 {Ledger::accounts::FIXED_ASSETS, "Основные средства"},
210 {Ledger::accounts::INTANGIBLE_ASSETS, "Нематериальные активы"},
211 {Ledger::accounts::MATERIALS_GOODS, "Материалы, товары"},
212 {Ledger::accounts::MAIN_PRODUCTION, "Основное производство"},
213 {Ledger::accounts::NON_PROFIT_ACTIVITY, "Некоммерческая деятельность"},
214 {Ledger::accounts::GENERAL_EXPENSES, "Общехозяйственные расходы"},
215 {Ledger::accounts::CASH, "Касса"},
216 {Ledger::accounts::BANK_ACCOUNT, "Расчетный счет"},
217 {Ledger::accounts::RESERVES, "Резервы по сомнительным долгам"},
218 {Ledger::accounts::LONG_TERM_LOANS, "Расчеты по долгосрочным кредитам и займам"},
219 {Ledger::accounts::TAXES_FEES, "Расчеты с бюджетом по налогам и сборам"},
220 {Ledger::accounts::SOCIAL_INSURANCE, "Расчеты по социальному страхованию и обеспечению"},
221 {Ledger::accounts::SALARY, "Заработная плата"},
222 {Ledger::accounts::ACCOUNTABLE_PERSONS, "Расчеты с подотчетными лицами"},
223 {Ledger::accounts::MEMBER_SETTLEMENTS, "Расчеты с пайщиками по внесению/возврату паевых взносов"},
224 {Ledger::accounts::SHARE_FUND, "Паевой фонд (складочный капитал)"},
225 {Ledger::accounts::ADDITIONAL_CAPITAL, "Добавочный капитал"},
226 {Ledger::accounts::TARGET_RECEIPTS, "Целевые поступления"},
227 {Ledger::accounts::OTHER_INCOME_EXPENSES, "Прочие доходы и расходы"},
228 {Ledger::accounts::FUTURE_EXPENSES_RESERVE, "Резерв предстоящих расходов"},
229 {Ledger::accounts::FUTURE_INCOME, "Доходы будущих периодов"},
230 {Ledger::accounts::SHARES_AND_STAKES, "Доли, паи и акции в организациях"},
231 {Ledger::accounts::SECURITIES, "Облигации (государственные ценные бумаги)"},
232 {Ledger::accounts::LOANS_ISSUED, "Расчеты по выданным займам"},
233 {Ledger::accounts::MEMBER_DEBT, "Задолженность пайщиков по внесению взносов в паевой фонд"},
234 {Ledger::accounts::INCOME_ACCRUALS, "Начисление доходов участникам от предпринимательской деятельности ПО"},
235 {Ledger::accounts::MEMBER_FEES, "По членским взносам"},
236 {Ledger::accounts::PROPERTY_TRANSFER, "По передаче имущества для некоммерческой деятельности"},
237 {Ledger::accounts::OTHER_SETTLEMENTS, "Другие расчеты"},
238 {Ledger::accounts::DEBTORS_CREDITORS, "Расчеты с дебиторами и кредиторами"},
239 {Ledger::accounts::ENTRANCE_FEES, "Вступительные взносы"},
240 {Ledger::accounts::FUNDS_PO_1, "Фонды ПО (вариант пополнения фондов ПО)"},
241 {Ledger::accounts::CURRENT_YEAR_PROFIT, "Нераспределенная прибыль (убыток) отчетного года"},
242 {Ledger::accounts::PREVIOUS_YEARS_PROFIT, "Нераспределенная прибыль (непокрытый убыток) прошлых лет"},
243 {Ledger::accounts::FUNDS_PO_2, "Фонды ПО (вариант пополнения фондов ПО)"},
244 {Ledger::accounts::UNDISTRIBUTED_PROFIT, "Нераспределенная прибыль (непокрытый убыток)"},
245 {Ledger::accounts::RESERVE_FUND, "Резервный фонд"},
246 {Ledger::accounts::INDIVISIBLE_FUND, "Неделимый фонд"},
247 {Ledger::accounts::ECONOMIC_ACTIVITY_FUND, "Фонд обеспечения хозяйственной деятельности"},
248 {Ledger::accounts::MUTUAL_SECURITY_FUND, "Фонд взаимного обеспечения"},
249 {Ledger::accounts::DEVELOPMENT_FUND, "Фонд развития потребительской кооперации"},
250 {Ledger::accounts::LOAN_INTEREST, "Внесение процентов за пользование займами"},
251 {Ledger::accounts::FINANCIAL_INVESTMENTS, "Финансовые вложения из средств ПО"},
252 {Ledger::accounts::FREE_RECEIPT, "Безвозмездное получение имущества"}
253};
254
255// Реализация статических методов класса Ledger
256
263const std::set<eosio::name> Ledger::ledger_actions = {
264 "add"_n,
265 "sub"_n,
266 "block"_n,
267 "unblock"_n,
268 "writeoff"_n,
269 "writeoffcnsl"_n,
270 "create"_n,
271 "auth"_n,
272 "complete"_n,
273 "decline"_n
274};
275
276inline eosio::name Ledger::get_valid_ledger_action(const eosio::name& action) {
277 eosio::check(ledger_actions.contains(action), "Недопустимое имя действия ledger");
278 return action;
279}
280
281inline void Ledger::check_ledger_symbol(const eosio::asset& amount) {
282 eosio::check(amount.symbol == _root_govern_symbol, "Некорректный символ валюты для операций ledger");
283}
284
285inline void Ledger::check_positive_amount(const eosio::asset& amount) {
286 eosio::check(amount.is_valid(), "Некорректная сумма");
287 eosio::check(amount.amount > 0, "Сумма должна быть положительной");
288}
289
290inline std::string Ledger::get_account_name_by_id(uint64_t account_id) {
291 for (const auto& account_data : ACCOUNT_MAP) {
292 if (std::get<0>(account_data) == account_id) {
293 return std::get<1>(account_data);
294 }
295 }
296 return "Неизвестный счет";
297}
298
307inline void Ledger::add(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment) {
309 eosio::permission_level{actor, "active"_n},
310 _ledger,
312 std::make_tuple(coopname, account_id, quantity, comment)
313 ).send();
314}
315
324inline void Ledger::sub(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment) {
326 eosio::permission_level{actor, "active"_n},
327 _ledger,
329 std::make_tuple(coopname, account_id, quantity, comment)
330 ).send();
331}
332
342inline void Ledger::transfer(eosio::name actor, eosio::name coopname, uint64_t from_account_id, uint64_t to_account_id, eosio::asset quantity, std::string comment) {
343 add(actor, coopname, from_account_id, quantity, comment);
344 sub(actor, coopname, to_account_id, quantity, comment);
345}
346
355inline void Ledger::block(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment) {
357 eosio::permission_level{actor, "active"_n},
358 _ledger,
359 get_valid_ledger_action("block"_n),
360 std::make_tuple(coopname, account_id, quantity, comment)
361 ).send();
362}
363
372inline void Ledger::unblock(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment) {
374 eosio::permission_level{actor, "active"_n},
375 _ledger,
376 get_valid_ledger_action("unblock"_n),
377 std::make_tuple(coopname, account_id, quantity, comment)
378 ).send();
379}
380
389inline void Ledger::writeoff(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment) {
391 eosio::permission_level{actor, "active"_n},
392 _ledger,
393 get_valid_ledger_action("writeoff"_n),
394 std::make_tuple(coopname, account_id, quantity, comment)
395 ).send();
396}
397
406inline void Ledger::writeoffcnsl(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment) {
408 eosio::permission_level{actor, "active"_n},
409 _ledger,
410 get_valid_ledger_action("writeoffcnsl"_n),
411 std::make_tuple(coopname, account_id, quantity, comment)
412 ).send();
413}
414
422inline void Ledger::add_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment) {
423 add(actor, coopname, accounts::TARGET_RECEIPTS, quantity, comment);
424}
425
433inline void Ledger::sub_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment) {
434 sub(actor, coopname, accounts::TARGET_RECEIPTS, quantity, comment);
435}
436
444inline void Ledger::block_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment) {
445 block(actor, coopname, accounts::TARGET_RECEIPTS, quantity, comment);
446}
447
455inline void Ledger::unblock_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment) {
456 unblock(actor, coopname, accounts::TARGET_RECEIPTS, quantity, comment);
457}
458
459inline std::optional<writeoff_op> Ledger::get_writeoff_by_hash(const checksum256 &writeoff_hash) {
460 writeoffs_index writeoffs(_ledger, _ledger.value);
461 auto hash_idx = writeoffs.get_index<"byhash"_n>();
462
463 auto op_iter = hash_idx.find(writeoff_hash);
464 if (op_iter == hash_idx.end()) {
465 return std::nullopt;
466 }
467
468 return *op_iter;
469}
Класс Ledger для интеграции с ledger контрактом
Definition: shared_ledger.hpp:80
static void unblock_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment)
Разблокировать членский взнос на счёте поступлений
Definition: shared_ledger.hpp:455
static void transfer(eosio::name actor, eosio::name coopname, uint64_t from_account_id, uint64_t to_account_id, eosio::asset quantity, std::string comment)
Перевести средства между счетами кооператива
Definition: shared_ledger.hpp:342
static void block_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment)
Заблокировать членский взнос на счёте поступлений
Definition: shared_ledger.hpp:444
static void block(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment)
Заблокировать средства на счёте кооператива
Definition: shared_ledger.hpp:355
static void writeoff(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment)
Списать средства со счёта кооператива
Definition: shared_ledger.hpp:389
static void writeoffcnsl(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment)
Списать средства со счёта кооператива
Definition: shared_ledger.hpp:406
static void add_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment)
Добавить членский взнос на счёт поступлений
Definition: shared_ledger.hpp:422
static void check_ledger_symbol(const eosio::asset &amount)
Проверка корректности символа валюты для операций ledger.
Definition: shared_ledger.hpp:281
static void sub_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment)
Вычесть членский взнос со счёта поступлений
Definition: shared_ledger.hpp:433
static void check_positive_amount(const eosio::asset &amount)
Проверка положительности суммы для операций ledger.
Definition: shared_ledger.hpp:285
static std::optional< writeoff_op > get_writeoff_by_hash(const checksum256 &writeoff_hash)
Получает операцию списания по хэшу
Definition: shared_ledger.hpp:459
static eosio::name get_valid_ledger_action(const eosio::name &action)
Проверка корректности действия ledger.
Definition: shared_ledger.hpp:276
static void add(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment)
Добавить средства на счёт кооператива
Definition: shared_ledger.hpp:307
static void sub(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment)
Уменьшить средства на счёте кооператива
Definition: shared_ledger.hpp:324
static void unblock(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment)
Разблокировать средства на счёте кооператива
Definition: shared_ledger.hpp:372
static std::string get_account_name_by_id(uint64_t account_id)
Получает название счета по его ID из ACCOUNT_MAP.
Definition: shared_ledger.hpp:290
static constexpr eosio::symbol _root_govern_symbol
Definition: consts.hpp:210
static constexpr eosio::name _ledger
Definition: consts.hpp:163
contract
Definition: eosio.msig_tests.cpp:977
permission_level
Definition: eosio.msig_tests.cpp:896
share_type amount
Definition: eosio.token_tests.cpp:174
static const std::set< eosio::name > ledger_actions
Валидные действия ledger для интеграции с другими контрактами
Definition: shared_ledger.hpp:86
static const std::vector< std::tuple< uint64_t, std::string > > ACCOUNT_MAP
Карта счетов для инициализации бухгалтерской книги СОХРАНЯЕМ - используется для получения названий пр...
Definition: shared_ledger.hpp:208
void send(name contract, name action_name, name actor, Args &&... args)
Definition: shared_actions.hpp:10
Definition: eosio.msig.hpp:34
action(permission_level{ _gateway, "active"_n}, _gateway, "adduser"_n, std::make_tuple(coopname, deposit->username, to_spread, to_circulation, eosio::current_time_point(), true)).send()
eosio::multi_index<"accounts"_n, laccount > laccounts_index
Типы индексов для таблиц ledger.
Definition: shared_ledger.hpp:45
eosio::multi_index<"writeoffs"_n, writeoff_op, eosio::indexed_by<"bycoop"_n, eosio::const_mem_fun< writeoff_op, uint64_t, &writeoff_op::by_coop > >, eosio::indexed_by<"byhash"_n, eosio::const_mem_fun< writeoff_op, checksum256, &writeoff_op::by_hash > > > writeoffs_index
Definition: shared_ledger.hpp:74
Константы счетов
Definition: shared_ledger.hpp:138
static constexpr uint64_t INTANGIBLE_ASSETS
Нематериальные активы
Definition: shared_ledger.hpp:170
static constexpr uint64_t TAXES_FEES
Расчеты с бюджетом по налогам и сборам
Definition: shared_ledger.hpp:177
static constexpr uint64_t FUNDS_PO_2
Фонды ПО (вариант пополнения фондов ПО)
Definition: shared_ledger.hpp:185
static constexpr uint64_t LONG_TERM_LOANS
Расчеты по долгосрочным кредитам и займам
Definition: shared_ledger.hpp:176
static constexpr uint64_t NON_PROFIT_ACTIVITY
Некоммерческая деятельность
Definition: shared_ledger.hpp:173
static constexpr uint64_t GENERAL_EXPENSES
Общехозяйственные расходы (содержание ПО)
Definition: shared_ledger.hpp:174
static constexpr uint64_t INDIVISIBLE_FUND
Неделимый фонд
Definition: shared_ledger.hpp:190
static constexpr uint64_t SHARE_FUND
Паевой фонд (складочный капитал)
Definition: shared_ledger.hpp:149
static constexpr uint64_t ENTRANCE_FEES
Вступительные взносы
Definition: shared_ledger.hpp:188
static constexpr uint64_t TARGET_RECEIPTS
Целевые поступления
Definition: shared_ledger.hpp:187
static constexpr uint64_t ADDITIONAL_CAPITAL
Добавочный капитал
Definition: shared_ledger.hpp:181
static constexpr uint64_t MATERIALS_GOODS
Материалы, товары
Definition: shared_ledger.hpp:171
static constexpr uint64_t MAIN_PRODUCTION
Основное производство
Definition: shared_ledger.hpp:172
static constexpr uint64_t FIXED_ASSETS
Основные средства
Definition: shared_ledger.hpp:169
static constexpr uint64_t PREVIOUS_YEARS_PROFIT
Нераспределенная прибыль (непокрытый убыток) прошлых лет
Definition: shared_ledger.hpp:184
static constexpr uint64_t MUTUAL_SECURITY_FUND
Фонд взаимного обеспечения
Definition: shared_ledger.hpp:192
static constexpr uint64_t SALARY
Заработная плата
Definition: shared_ledger.hpp:179
static constexpr uint64_t RESERVE_FUND
Резервный фонд
Definition: shared_ledger.hpp:189
static constexpr uint64_t FINANCIAL_INVESTMENTS
Финансовые вложения из средств ПО
Definition: shared_ledger.hpp:161
static constexpr uint64_t PROPERTY_TRANSFER
По передаче имущества для некоммерческой деятельности
Definition: shared_ledger.hpp:153
static constexpr uint64_t INCOME_ACCRUALS
Начисление доходов участникам от предпринимательской деятельности ПО (кооперативные выплаты)
Definition: shared_ledger.hpp:146
static constexpr uint64_t UNDISTRIBUTED_PROFIT
Нераспределенная прибыль (непокрытый убыток)
Definition: shared_ledger.hpp:186
static constexpr uint64_t CASH
Касса
Definition: shared_ledger.hpp:140
static constexpr uint64_t SECURITIES
Облигации (государственные ценные бумаги)
Definition: shared_ledger.hpp:163
static constexpr uint64_t MEMBER_SETTLEMENTS
Расчеты с пайщиками по внесению/возврату паевых взносов
Definition: shared_ledger.hpp:144
static constexpr uint64_t FREE_RECEIPT
Безвозмездное получение имущества
Definition: shared_ledger.hpp:197
static constexpr uint64_t CURRENT_YEAR_PROFIT
Нераспределенная прибыль (убыток) отчетного года
Definition: shared_ledger.hpp:183
static constexpr uint64_t FUNDS_PO_1
Фонды ПО (вариант пополнения фондов ПО)
Definition: shared_ledger.hpp:182
static constexpr uint64_t DEVELOPMENT_FUND
Фонд развития потребительской кооперации
Definition: shared_ledger.hpp:193
static constexpr uint64_t ECONOMIC_ACTIVITY_FUND
Фонд обеспечения хозяйственной деятельности
Definition: shared_ledger.hpp:191
static constexpr uint64_t MEMBER_DEBT
Задолженность пайщиков по внесению взносов в паевой фонд
Definition: shared_ledger.hpp:145
static constexpr uint64_t LOANS_ISSUED
Расчеты по выданным займам
Definition: shared_ledger.hpp:157
static constexpr uint64_t BANK_ACCOUNT
Расчетный счет
Definition: shared_ledger.hpp:141
static constexpr uint64_t ACCOUNTABLE_PERSONS
Расчеты с подотчетными лицами
Definition: shared_ledger.hpp:180
static constexpr uint64_t OTHER_SETTLEMENTS
Другие расчеты
Definition: shared_ledger.hpp:154
static constexpr uint64_t SOCIAL_INSURANCE
Расчеты по социальному страхованию и обеспечению
Definition: shared_ledger.hpp:178
static constexpr uint64_t LOAN_INTEREST
Внесение процентов за пользование займами
Definition: shared_ledger.hpp:158
static constexpr uint64_t DEBTORS_CREDITORS
Расчеты с дебиторами и кредиторами
Definition: shared_ledger.hpp:166
static constexpr uint64_t SHARES_AND_STAKES
Доли, паи и акции в организациях, где участвует ПО
Definition: shared_ledger.hpp:162
static constexpr uint64_t FUTURE_EXPENSES_RESERVE
Резерв предстоящих расходов
Definition: shared_ledger.hpp:195
static constexpr uint64_t MEMBER_FEES
По членским взносам
Definition: shared_ledger.hpp:152
static constexpr uint64_t FUTURE_INCOME
Доходы будущих периодов
Definition: shared_ledger.hpp:196
static constexpr uint64_t OTHER_INCOME_EXPENSES
Прочие доходы и расходы
Definition: shared_ledger.hpp:194
static constexpr uint64_t RESERVES
Резервы по сомнительным долгам
Definition: shared_ledger.hpp:175
Definition: drafts.hpp:28
Структура бухгалтерского счета
Definition: shared_ledger.hpp:11
uint64_t id
Идентификатор счета
Definition: shared_ledger.hpp:12
bool is_empty() const
Проверяет, пуст ли счет (все балансы равны нулю)
Definition: shared_ledger.hpp:23
eosio::asset get_total() const
Получает общий баланс счета
Definition: shared_ledger.hpp:30
std::string name
Название счета
Definition: shared_ledger.hpp:13
eosio::asset get_balance() const
Получает всего доступных + заблокированных средств (без списанных)
Definition: shared_ledger.hpp:37
uint64_t primary_key() const
Definition: shared_ledger.hpp:18
eosio::asset available
Доступные средства (было allocation)
Definition: shared_ledger.hpp:14
eosio::asset blocked
Заблокированные средства
Definition: shared_ledger.hpp:15
eosio::asset writeoff
Списанные средства
Definition: shared_ledger.hpp:16
Структура для операций ожидающих решения совета
Definition: shared_ledger.hpp:55
uint64_t account_id
Счет для операции
Definition: shared_ledger.hpp:59
uint64_t primary_key() const
Definition: shared_ledger.hpp:66
eosio::name status
Статус: pending, approved, declined, paid.
Definition: shared_ledger.hpp:64
eosio::name coopname
Имя кооператива
Definition: shared_ledger.hpp:57
eosio::asset quantity
Сумма операции
Definition: shared_ledger.hpp:60
checksum256 writeoff_hash
Хэш операции списания
Definition: shared_ledger.hpp:63
uint64_t id
Идентификатор операции
Definition: shared_ledger.hpp:56
eosio::name username
Инициатор операции
Definition: shared_ledger.hpp:58
uint64_t by_coop() const
Definition: shared_ledger.hpp:67
std::string reason
Обоснование
Definition: shared_ledger.hpp:61
document2 document
Документ обоснования
Definition: shared_ledger.hpp:62
checksum256 by_hash() const
Definition: shared_ledger.hpp:68