9#include <eosio/asset.hpp>
10#include <eosio/crypto.hpp>
11#include <eosio/eosio.hpp>
13#include "../../consts.hpp"
43 static void add(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
44 static void sub(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
45 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, checksum256 hash, eosio::name username);
48 static void block(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
49 static void unblock(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
52 static void writeoff(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
53 static void writeoffcnsl(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
56 static void add_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
57 static void sub_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
58 static void block_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
59 static void unblock_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username);
79 static constexpr uint64_t
CASH = 50;
148static const std::vector<std::tuple<uint64_t, std::string>>
ACCOUNT_MAP = {
227 eosio::check(
amount.is_valid(),
"Некорректная сумма");
228 eosio::check(
amount.amount > 0,
"Сумма должна быть положительной");
233 if (std::get<0>(account_data) == account_id) {
234 return std::get<1>(account_data);
237 return "Неизвестный счет";
250inline void Ledger::add(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
255 std::make_tuple(coopname, account_id, quantity, comment, hash, username)
269inline void Ledger::sub(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
274 std::make_tuple(coopname, account_id, quantity, comment, hash, username)
289inline 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, checksum256 hash, eosio::name username) {
290 add(actor, coopname, from_account_id, quantity, comment, hash, username);
291 sub(actor, coopname, to_account_id, quantity, comment, hash, username);
304inline void Ledger::block(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
309 std::make_tuple(coopname, account_id, quantity, comment, hash, username)
323inline void Ledger::unblock(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
328 std::make_tuple(coopname, account_id, quantity, comment, hash, username)
342inline void Ledger::writeoff(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
347 std::make_tuple(coopname, account_id, quantity, comment, hash, username)
361inline void Ledger::writeoffcnsl(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
366 std::make_tuple(coopname, account_id, quantity, comment, hash, username)
379inline void Ledger::add_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
392inline void Ledger::sub_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
405inline void Ledger::block_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
418inline void Ledger::unblock_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username) {
424 auto hash_idx = writeoffs.get_index<
"byhash"_n>();
426 auto op_iter = hash_idx.find(writeoff_hash);
427 if (op_iter == hash_idx.end()) {
Класс Ledger для интеграции с ledger контрактом
Definition: ledger.hpp:19
static void sub_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Вычесть членский взнос со счёта поступлений
Definition: ledger.hpp:392
static void block(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Заблокировать средства на счёте кооператива
Definition: ledger.hpp:304
static void unblock(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Разблокировать средства на счёте кооператива
Definition: ledger.hpp:323
static void writeoff(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Списать средства со счёта кооператива
Definition: ledger.hpp:342
static void add(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Добавить средства на счёт кооператива
Definition: ledger.hpp:250
static void sub(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Уменьшить средства на счёте кооператива
Definition: ledger.hpp:269
static void check_ledger_symbol(const eosio::asset &amount)
Проверка корректности символа валюты для операций ledger.
Definition: ledger.hpp:222
static void unblock_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Разблокировать членский взнос на счёте поступлений
Definition: ledger.hpp:418
static void check_positive_amount(const eosio::asset &amount)
Проверка положительности суммы для операций ledger.
Definition: ledger.hpp:226
static std::optional< writeoff_op > get_writeoff_by_hash(const checksum256 &writeoff_hash)
Получает операцию списания по хэшу
Definition: ledger.hpp:422
static eosio::name get_valid_ledger_action(const eosio::name &action)
Проверка корректности действия ledger.
Definition: ledger.hpp:217
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, checksum256 hash, eosio::name username)
Перевести средства между счетами кооператива
Definition: ledger.hpp:289
static void writeoffcnsl(eosio::name actor, eosio::name coopname, uint64_t account_id, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Отменить списание средств со счёта кооператива
Definition: ledger.hpp:361
static void block_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Заблокировать членский взнос на счёте поступлений
Definition: ledger.hpp:405
static std::string get_account_name_by_id(uint64_t account_id)
Получает название счета по его ID из ACCOUNT_MAP.
Definition: ledger.hpp:231
static void add_membership_fee(eosio::name actor, eosio::name coopname, eosio::asset quantity, std::string comment, checksum256 hash, eosio::name username)
Добавить членский взнос на счёт поступлений
Definition: ledger.hpp:379
static constexpr eosio::symbol _root_govern_symbol
Definition: consts.hpp:209
static constexpr eosio::name _ledger
Definition: consts.hpp:163
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: ledger.hpp:25
static const std::vector< std::tuple< uint64_t, std::string > > ACCOUNT_MAP
Карта счетов для инициализации бухгалтерской книги СОХРАНЯЕМ - используется для получения названий пр...
Definition: ledger.hpp:148
void send(name contract, name action_name, name actor, Args &&... args)
Definition: actions.hpp:10
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()
Константы счетов
Definition: ledger.hpp:77
static constexpr uint64_t INTANGIBLE_ASSETS
Нематериальные активы
Definition: ledger.hpp:109
static constexpr uint64_t TAXES_FEES
Расчеты с бюджетом по налогам и сборам
Definition: ledger.hpp:116
static constexpr uint64_t FUNDS_PO_2
Фонды ПО (вариант пополнения фондов ПО)
Definition: ledger.hpp:124
static constexpr uint64_t LONG_TERM_LOANS
Расчеты по долгосрочным кредитам и займам
Definition: ledger.hpp:115
static constexpr uint64_t NON_PROFIT_ACTIVITY
Некоммерческая деятельность
Definition: ledger.hpp:112
static constexpr uint64_t GENERAL_EXPENSES
Общехозяйственные расходы (содержание ПО)
Definition: ledger.hpp:113
static constexpr uint64_t INDIVISIBLE_FUND
Неделимый фонд
Definition: ledger.hpp:129
static constexpr uint64_t SHARE_FUND
Паевой фонд (складочный капитал)
Definition: ledger.hpp:88
static constexpr uint64_t ENTRANCE_FEES
Вступительные взносы
Definition: ledger.hpp:127
static constexpr uint64_t TARGET_RECEIPTS
Целевые поступления
Definition: ledger.hpp:126
static constexpr uint64_t ADDITIONAL_CAPITAL
Добавочный капитал
Definition: ledger.hpp:120
static constexpr uint64_t MATERIALS_GOODS
Материалы, товары
Definition: ledger.hpp:110
static constexpr uint64_t MAIN_PRODUCTION
Основное производство
Definition: ledger.hpp:111
static constexpr uint64_t FIXED_ASSETS
Основные средства
Definition: ledger.hpp:108
static constexpr uint64_t PREVIOUS_YEARS_PROFIT
Нераспределенная прибыль (непокрытый убыток) прошлых лет
Definition: ledger.hpp:123
static constexpr uint64_t MUTUAL_SECURITY_FUND
Фонд взаимного обеспечения
Definition: ledger.hpp:131
static constexpr uint64_t SALARY
Заработная плата
Definition: ledger.hpp:118
static constexpr uint64_t RESERVE_FUND
Резервный фонд
Definition: ledger.hpp:128
static constexpr uint64_t FINANCIAL_INVESTMENTS
Финансовые вложения из средств ПО
Definition: ledger.hpp:100
static constexpr uint64_t PROPERTY_TRANSFER
По передаче имущества для некоммерческой деятельности
Definition: ledger.hpp:92
static constexpr uint64_t INCOME_ACCRUALS
Начисление доходов участникам от предпринимательской деятельности ПО (кооперативные выплаты)
Definition: ledger.hpp:85
static constexpr uint64_t UNDISTRIBUTED_PROFIT
Нераспределенная прибыль (непокрытый убыток)
Definition: ledger.hpp:125
static constexpr uint64_t CASH
Касса
Definition: ledger.hpp:79
static constexpr uint64_t SECURITIES
Облигации (государственные ценные бумаги)
Definition: ledger.hpp:102
static constexpr uint64_t MEMBER_SETTLEMENTS
Расчеты с пайщиками по внесению/возврату паевых взносов
Definition: ledger.hpp:83
static constexpr uint64_t FREE_RECEIPT
Безвозмездное получение имущества
Definition: ledger.hpp:137
static constexpr uint64_t CURRENT_YEAR_PROFIT
Нераспределенная прибыль (убыток) отчетного года
Definition: ledger.hpp:122
static constexpr uint64_t FUNDS_PO_1
Фонды ПО (вариант пополнения фондов ПО)
Definition: ledger.hpp:121
static constexpr uint64_t DEVELOPMENT_FUND
Фонд развития потребительской кооперации
Definition: ledger.hpp:132
static constexpr uint64_t ECONOMIC_ACTIVITY_FUND
Фонд обеспечения хозяйственной деятельности
Definition: ledger.hpp:130
static constexpr uint64_t DELEGATE_FEES_FUND
Членские взносы делегатов
Definition: ledger.hpp:133
static constexpr uint64_t MEMBER_DEBT
Задолженность пайщиков по внесению взносов в паевой фонд
Definition: ledger.hpp:84
static constexpr uint64_t LOANS_ISSUED
Расчеты по выданным займам
Definition: ledger.hpp:96
static constexpr uint64_t BANK_ACCOUNT
Расчетный счет
Definition: ledger.hpp:80
static constexpr uint64_t ACCOUNTABLE_PERSONS
Расчеты с подотчетными лицами
Definition: ledger.hpp:119
static constexpr uint64_t OTHER_SETTLEMENTS
Другие расчеты
Definition: ledger.hpp:93
static constexpr uint64_t SOCIAL_INSURANCE
Расчеты по социальному страхованию и обеспечению
Definition: ledger.hpp:117
static constexpr uint64_t LOAN_INTEREST
Внесение процентов за пользование займами
Definition: ledger.hpp:97
static constexpr uint64_t DEBTORS_CREDITORS
Расчеты с дебиторами и кредиторами
Definition: ledger.hpp:105
static constexpr uint64_t SHARES_AND_STAKES
Доли, паи и акции в организациях, где участвует ПО
Definition: ledger.hpp:101
static constexpr uint64_t FUTURE_EXPENSES_RESERVE
Резерв предстоящих расходов
Definition: ledger.hpp:135
static constexpr uint64_t MEMBER_FEES
По членским взносам
Definition: ledger.hpp:91
static constexpr uint64_t FUTURE_INCOME
Доходы будущих периодов
Definition: ledger.hpp:136
static constexpr uint64_t OTHER_INCOME_EXPENSES
Прочие доходы и расходы
Definition: ledger.hpp:134
static constexpr uint64_t RESERVES
Резервы по сомнительным долгам
Definition: ledger.hpp:114
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: table_ledger_writeoffs.hpp:36