{"id":406528,"date":"2024-06-29T19:00:05","date_gmt":"2024-06-29T19:00:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=406528"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=406528","title":{"rendered":"<span>Empire ERP. \u0417\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0438\u044f: \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0443\u0447\u0435\u0442, \u0447.1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439: <a href=\"https:\/\/github.com\/nomhoi\/empire-erp\" rel=\"nofollow noopener noreferrer\">https:\/\/github.com\/nomhoi\/empire-erp<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0443\u0447\u0435\u0442.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"nastroyka-proekta\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0433\u0438\u0442\u0445\u0430\u0431\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/nomhoi\/empire-erp.git<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 <strong>reaserch\/day3\/<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0435\u0441\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">docker-compose run test<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 <strong>empire-erp<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">docker exec -it db psql -U postgres -d empire-erp<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"step-1-prostye-scheta\">Step 1. \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u0441\u0447\u0435\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>\u0421\u0447\u0435\u0442\u0430 \u0431\u0435\u0437 \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u043e\u0432 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u0447\u0435\u0442\u0430\u043c\u0438. \u041d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 \u043f\u043e \u0441\u0447\u0435\u0442\u0430\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 <strong>psql<\/strong> \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">empire-erp=# \\i step1.sql<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b <strong>step1.sql<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_journal;  CREATE TABLE general_journal(     id        serial,     debit_id  smallint NOT NULL,     credit_id smallint NOT NULL,     amount    money NOT NULL );<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a <strong>general journal<\/strong>. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a, \u0430 \u043d\u0435 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043a\u043d\u0438\u0433\u0430.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u043a\u0430\u043a\u0438\u043c\u0438-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">INSERT INTO general_journal(debit_id, credit_id, amount) VALUES  (1, 12, 100.00),         (1, 6, 120.00),         (12, 1, 20.00); INSERT 0 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_journal ORDER BY    id;  id | debit_id | credit_id | amount   ----+----------+-----------+---------   1 |        1 |        12 | $100.00   2 |        1 |         6 | $120.00   3 |       12 |         1 |  $20.00 (3 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 <strong>general_ledger<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_ledger;  SELECT id                AS general_journal_id,        debit_id          AS account_id,        credit_id         AS corresp_id,        amount            AS debit_amount,        ( 0.00 ) :: money AS credit_amount INTO general_ledger FROM general_journal UNION SELECT id                AS general_journal_id,        credit_id         AS account_id,        debit_id          AS corresp_id,        ( 0.00 ) :: money AS debit_amount,        amount            AS credit_amount FROM general_journal ORDER BY general_journal_id; DROP TABLE SELECT 6<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_ledger ORDER BY    general_journal_id;  general_journal_id | account_id | corresp_id | debit_amount | credit_amount  --------------------+------------+------------+--------------+---------------                   1 |          1 |         12 |      $100.00 |         $0.00                   1 |         12 |          1 |        $0.00 |       $100.00                   2 |          1 |          6 |      $120.00 |         $0.00                   2 |          6 |          1 |        $0.00 |       $120.00                   3 |          1 |         12 |        $0.00 |        $20.00                   3 |         12 |          1 |       $20.00 |         $0.00 (6 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u043f\u043e \u0441\u0447\u0435\u0442\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      account_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger GROUP BY    account_id ORDER BY    account_id;  account_id | debit_turnout | credit_turnout  ------------+---------------+----------------           1 |       $220.00 |         $20.00           6 |         $0.00 |        $120.00          12 |        $20.00 |        $100.00 (3 rows) <\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"step-2-slozhnye-scheta\">Step 2. \u0421\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0447\u0435\u0442\u0430<\/h2>\n<p>  <\/p>\n<p>C\u0447\u0435\u0442\u0430 \u0441 \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u0430\u043c\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0447\u0435\u0442\u0430\u043c\u0438. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043f\u043e \u043d\u0430\u0448\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0441\u0447\u0435\u0442\u0430 1-4 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438, 5-8 \u2014 \u0430\u043a\u0442\u0438\u0432\u043d\u043e-\u043f\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u043c\u0438 \u0438 9-12 \u2014 \u043f\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u043c\u0438. \u0412\u0432\u0435\u0434\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435: \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0435\u0442\u043d\u044b\u0439 \u0441\u0447\u0435\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0441\u0447\u0435\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b <strong>step2.sql<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a <strong>general journal<\/strong> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_journal;  CREATE TABLE general_journal(     id              serial,     debit_id        smallint NOT NULL,     debit_sub_id    smallint,     credit_id       smallint NOT NULL,     credit_sub_id   smallint,     amount          money NOT NULL );<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u043a\u0430\u043a\u0438\u043c\u0438-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">INSERT INTO general_journal(debit_id, debit_sub_id, credit_id, credit_sub_id, amount) VALUES  ( 1, NULL, 12,    1, 100.00),         ( 1, NULL, 12,    2, 140.00),         ( 1, NULL,  6,    1, 120.00),         ( 6,    2,  1, NULL,  80.00),         (12,    1,  1, NULL,  20.00),         (12,    2,  1, NULL,  40.00);  INSERT 0 6<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0447\u0435\u0442\u0430\u0445 \u0441\u0443\u0431\u0441\u0447\u0435\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 NULL, \u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0447\u0435\u0442\u0430\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u044b\u043c NULL. \u041c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0440\u0438\u0433\u0433\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_journal ORDER BY    id;  id | debit_id | debit_sub_id | credit_id | credit_sub_id | amount   ----+----------+--------------+-----------+---------------+---------   1 |        1 |              |        12 |             1 | $100.00   2 |        1 |              |        12 |             2 | $140.00   3 |        1 |              |         6 |             1 | $120.00   4 |        6 |            2 |         1 |               |  $80.00   5 |       12 |            1 |         1 |               |  $20.00   6 |       12 |            2 |         1 |               |  $40.00 (6 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 <strong>general_ledger<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_ledger;  SELECT id                AS gj_id,        debit_id          AS acc_id,        debit_sub_id      AS acc_sub_id,        credit_id         AS cor_id,        credit_sub_id     AS cor_sub_id,        amount            AS debit_amount,        ( 0.00 ) :: money AS credit_amount INTO general_ledger FROM general_journal UNION SELECT id                AS gj_id,        credit_id         AS acc_id,        credit_sub_id     AS acc_sub_id,        debit_id          AS cor_id,        debit_sub_id      AS cor_sub_id,        ( 0.00 ) :: money AS debit_amount,        amount            AS credit_amount FROM general_journal ORDER BY gj_id; DROP TABLE SELECT 12<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_ledger ORDER BY    gj_id;  gj_id | acc_id | acc_sub_id | cor_id | cor_sub_id | debit_amount | credit_amount  -------+--------+------------+--------+------------+--------------+---------------      1 |      1 |            |     12 |          1 |      $100.00 |         $0.00      1 |     12 |          1 |      1 |            |        $0.00 |       $100.00      2 |      1 |            |     12 |          2 |      $140.00 |         $0.00      2 |     12 |          2 |      1 |            |        $0.00 |       $140.00      3 |      1 |            |      6 |          1 |      $120.00 |         $0.00      3 |      6 |          1 |      1 |            |        $0.00 |       $120.00      4 |      1 |            |      6 |          2 |        $0.00 |        $80.00      4 |      6 |          2 |      1 |            |       $80.00 |         $0.00      5 |      1 |            |     12 |          1 |        $0.00 |        $20.00      5 |     12 |          1 |      1 |            |       $20.00 |         $0.00      6 |      1 |            |     12 |          2 |        $0.00 |        $40.00      6 |     12 |          2 |      1 |            |       $40.00 |         $0.00 (12 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u043f\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0447\u0435\u0442\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      acc_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger GROUP BY    acc_id ORDER BY    acc_id;  acc_id | debit_turnout | credit_turnout  --------+---------------+----------------       1 |       $360.00 |        $140.00       6 |        $80.00 |        $120.00      12 |        $60.00 |        $240.00 (3 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u043f\u043e \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      acc_id,             acc_sub_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger GROUP BY    acc_id, acc_sub_id ORDER BY    acc_id, acc_sub_id;  acc_id | acc_sub_id | debit_turnout | credit_turnout  --------+------------+---------------+----------------       1 |            |       $360.00 |        $140.00       6 |          1 |         $0.00 |        $120.00       6 |          2 |        $80.00 |          $0.00      12 |          1 |        $20.00 |        $100.00      12 |          2 |        $40.00 |        $140.00 (5 rows) <\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"step-3-schet-materialy-sinteticheskiy-uchet\">Step 3. \u0421\u0447\u0435\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b. \u0421\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0443\u0447\u0435\u0442<\/h2>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0435\u043d\u0430\u0434\u043e\u043b\u0433\u043e \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043d\u0430 \u0417\u0435\u043c\u043b\u044e, \u0432 \u0420\u043e\u0441\u0441\u0438\u044e. \u0411\u0443\u0434\u0435\u043c \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0438 \u043f\u043e\u0442\u0440\u043e\u0433\u0430\u0442\u044c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0447\u0435\u0442 10 &#171;\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b&#187;.<\/p>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b <strong>step3.sql<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_journal;  CREATE TABLE general_journal(     id              serial,     debit_id        smallint NOT NULL,     credit_id       smallint NOT NULL,     amount          money NOT NULL );<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0447\u0435\u0442\u0430 10:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">INSERT INTO general_journal(debit_id, credit_id, amount) VALUES  (10, 60, 400.00),         (19, 60,  72.00),         (20, 10,  50.00); INSERT 0 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u043e\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043e\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0430. \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u043e\u0439 \u043d\u0430\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u041d\u0414\u0421.<br \/>  \u0422\u0440\u0435\u0442\u044c\u0435\u0439 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u043e\u0439 \u043e\u0442\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u043e.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_journal ORDER BY    id;  id | debit_id | credit_id | amount   ----+----------+-----------+---------   1 |       10 |        60 | $400.00   2 |       19 |        60 |  $72.00   3 |       20 |        10 |  $50.00 (3 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 <strong>general_ledger<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_ledger;  SELECT id                AS gj_id,        debit_id          AS account_id,        credit_id         AS corresp_id,        amount            AS debit_amount,        ( 0.00 ) :: money AS credit_amount INTO general_ledger FROM general_journal UNION SELECT id                AS gj_id,        credit_id         AS account_id,        debit_id          AS corresp_id,        ( 0.00 ) :: money AS debit_amount,        amount            AS credit_amount FROM general_journal ORDER BY gj_id; DROP TABLE SELECT 6<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_ledger ORDER BY    gj_id;  gj_id | account_id | corresp_id | debit_amount | credit_amount  -------+------------+------------+--------------+---------------      1 |         10 |         60 |      $400.00 |         $0.00      1 |         60 |         10 |        $0.00 |       $400.00      2 |         19 |         60 |       $72.00 |         $0.00      2 |         60 |         19 |        $0.00 |        $72.00      3 |         10 |         20 |        $0.00 |        $50.00      3 |         20 |         10 |       $50.00 |         $0.00 (6 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u043f\u043e \u0441\u0447\u0435\u0442\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      account_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger GROUP BY    account_id ORDER BY    account_id;  account_id | debit_turnout | credit_turnout  ------------+---------------+----------------          10 |       $400.00 |         $50.00          19 |        $72.00 |          $0.00          20 |        $50.00 |          $0.00          60 |         $0.00 |        $472.00 (4 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0438 \u0438\u043c\u0435\u044e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044e \u2014 \u043f\u0440\u0438\u0445\u043e\u0434 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432. \u042d\u0442\u043e\u043c\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b: \u0442\u043e\u0432\u0430\u0440\u043d\u043e-\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u0430\u044f \u043d\u0430\u043a\u0430\u043b\u0430\u0434\u043d\u0430\u044f \u0438 \u0441\u0447\u0435\u0442-\u0444\u0430\u043a\u0442\u0443\u0440\u0430. \u0422\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0430 \u2014 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0441\u043e \u0441\u043a\u043b\u0430\u0434\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u043e. \u042d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0442\u043e\u0436\u0435 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e\u0439.<br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 general_journal \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u0410 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u0438\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439) \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043e\u0434\u0438\u043d-\u043a\u043e-\u043c\u043d\u043e\u0433\u0438\u043c \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u0432 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0441\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0420\u043e\u0441\u0441\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0430\u043c\u0438 \u043f\u043e \u0441\u0447\u0435\u0442\u0443 10 \u0438 19, \u0430 \u043d\u0430 \u0437\u0430\u043f\u0430\u0434\u0435, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"step-4-schet-materialy-analiticheskiy-uchet\">Step 4. \u0421\u0447\u0435\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b. \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0443\u0447\u0435\u0442<\/h2>\n<p>  <\/p>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043a\u043b\u0430\u0434\u0430\u0445. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043a\u043b\u0430\u0434\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b <strong>step4.sql<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_journal;  CREATE TABLE general_journal(     id              serial,     debit_id        smallint NOT NULL,     debit_sub_id    smallint,     debit_stock_id  smallint,     credit_id       smallint NOT NULL,     credit_sub_id   smallint,     credit_stock_id smallint,     amount          money NOT NULL );  DROP TABLE IF EXISTS stock;  CREATE TABLE stock(     id              serial,     name            text );<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u043a\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0447\u0435\u0442\u0430 10:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">INSERT INTO general_journal(debit_id, debit_sub_id, debit_stock_id, credit_id, credit_sub_id, credit_stock_id, amount) VALUES  (10,  1,    1, 60,  1, NULL, 100.00),         (10,  1,    2, 60,  1, NULL, 200.00),         (10,  2,    1, 60,  1, NULL, 100.00),         (19,  3, NULL, 60,  1, NULL,  72.00),         (20,  3, NULL, 10,  1,    1,  50.00); INSERT 0 5<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0436\u0443\u0440\u043d\u0430\u043b\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_journal ORDER BY    id;  id | debit_id | debit_sub_id | debit_stock_id | credit_id | credit_sub_id | credit_stock_id | amount   ----+----------+--------------+----------------+-----------+---------------+-----------------+---------   1 |       10 |            1 |              1 |        60 |             1 |                 | $100.00   2 |       10 |            1 |              2 |        60 |             1 |                 | $200.00   3 |       10 |            2 |              1 |        60 |             1 |                 | $100.00   4 |       19 |            3 |                |        60 |             1 |                 |  $72.00   5 |       20 |            3 |                |        10 |             1 |               1 |  $50.00 (5 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 <strong>general_ledger<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS general_ledger;  SELECT id                AS gj_id,        debit_id          AS acc_id,        debit_sub_id      AS acc_sub_id,        debit_stock_id    AS acc_stock_id,        credit_id         AS cor_id,        credit_sub_id     AS cor_sub_id,        credit_stock_id   AS cor_stock_id,        amount            AS debit_amount,        ( 0.00 ) :: money AS credit_amount INTO general_ledger FROM general_journal UNION SELECT id                AS gj_id,        credit_id         AS acc_id,        credit_sub_id     AS acc_sub_id,        credit_stock_id   AS acc_stock_id,        debit_id          AS cor_id,        debit_sub_id      AS cor_sub_id,        debit_stock_id    AS cor_stock_id,        ( 0.00 ) :: money AS debit_amount,        amount            AS credit_amount FROM general_journal ORDER BY gj_id; DROP TABLE SELECT 10<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      * FROM        general_ledger ORDER BY    gj_id;  gj_id | acc_id | acc_sub_id | acc_stock_id | cor_id | cor_sub_id | cor_stock_id | debit_amount | credit_amount  -------+--------+------------+--------------+--------+------------+--------------+--------------+---------------      1 |     10 |          1 |            1 |     60 |          1 |              |      $100.00 |         $0.00      1 |     60 |          1 |              |     10 |          1 |            1 |        $0.00 |       $100.00      2 |     10 |          1 |            2 |     60 |          1 |              |      $200.00 |         $0.00      2 |     60 |          1 |              |     10 |          1 |            2 |        $0.00 |       $200.00      3 |     10 |          2 |            1 |     60 |          1 |              |      $100.00 |         $0.00      3 |     60 |          1 |              |     10 |          2 |            1 |        $0.00 |       $100.00      4 |     19 |          3 |              |     60 |          1 |              |       $72.00 |         $0.00      4 |     60 |          1 |              |     19 |          3 |              |        $0.00 |        $72.00      5 |     10 |          1 |            1 |     20 |          3 |              |        $0.00 |        $50.00      5 |     20 |          3 |              |     10 |          1 |            1 |       $50.00 |         $0.00 (10 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u043f\u043e \u0441\u0447\u0435\u0442\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      acc_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger GROUP BY    acc_id ORDER BY    acc_id;  acc_id | debit_turnout | credit_turnout  --------+---------------+----------------      10 |       $400.00 |         $50.00      19 |        $72.00 |          $0.00      20 |        $50.00 |          $0.00      60 |         $0.00 |        $472.00 (4 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u043f\u043e \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      acc_id,             acc_sub_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger GROUP BY    acc_id, acc_sub_id ORDER BY    acc_id, acc_sub_id;  acc_id | acc_sub_id | debit_turnout | credit_turnout  --------+------------+---------------+----------------      10 |          1 |       $300.00 |         $50.00      10 |          2 |       $100.00 |          $0.00      19 |          3 |        $72.00 |          $0.00      20 |          3 |        $50.00 |          $0.00      60 |          1 |         $0.00 |        $472.00 (5 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u043f\u043e \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u0430\u043c \u0438 \u0441\u043a\u043b\u0430\u0434\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      acc_id,             acc_sub_id,             acc_stock_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger GROUP BY    acc_id, acc_sub_id, acc_stock_id ORDER BY    acc_id, acc_sub_id, acc_stock_id;  acc_id | acc_sub_id | acc_stock_id | debit_turnout | credit_turnout  --------+------------+--------------+---------------+----------------      10 |          1 |            1 |       $100.00 |         $50.00      10 |          1 |            2 |       $200.00 |          $0.00      10 |          2 |            1 |       $100.00 |          $0.00      19 |          3 |              |        $72.00 |          $0.00      20 |          3 |              |        $50.00 |          $0.00      60 |          1 |              |         $0.00 |        $472.00 (6 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u043e\u0440\u043e\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0441\u0447\u0435\u0442\u0443 10 \u0438 \u0441\u043a\u043b\u0430\u0434\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT      acc_stock_id,             sum(debit_amount)   AS debit_turnout,             sum(credit_amount)  AS credit_turnout FROM        general_ledger WHERE       acc_id = 10 GROUP BY    acc_stock_id ORDER BY    acc_stock_id;  acc_stock_id | debit_turnout | credit_turnout  --------------+---------------+----------------             1 |       $200.00 |         $50.00             2 |       $200.00 |          $0.00 (2 rows) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0436\u0443\u0440\u043d\u0430\u043b general_journal. \u0417\u0434\u0435\u0441\u044c, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0434\u043b\u044f \u0441\u0447\u0435\u0442\u043e\u0432 19, 20 \u0438 60 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u043a\u043b\u0430\u0434\u043e\u0432. \u0414\u043b\u044f \u0441\u0447\u0435\u0442\u0430 10 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043a\u043b\u0430\u0434\u0430 \u043f\u043e \u0434\u0435\u0431\u0435\u0442\u0443 \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443 \u043f\u043e \u0434\u0435\u0431\u0435\u0442\u0443, \u0438, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043a\u043b\u0430\u0434\u0430 \u043f\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u0443 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443 \u043f\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u0443. <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0447\u0435\u0442\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0436\u0443\u0440\u043d\u0430\u043b \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u0435\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0434\u043d\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0447\u0435\u0442\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f 19 \u0441\u0447\u0435\u0442\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0447\u0435\u0442\u043e\u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u043b\u044f. \u0421 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0442\u0447\u0435\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<h2 id=\"step-5-zanimatelnoe\">Step 5. \u0417\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435<\/h2>\n<p>  <\/p>\n<ol>\n<li>\u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u044b 10 Knowledge Representation \u043a\u043d\u0438\u0433\u0438 <a href=\"http:\/\/aima.cs.berkeley.edu\/newchap00.pdf\" rel=\"nofollow noopener noreferrer\">Artificial Intelligence. A Modern Approach<\/a> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043b\u0430\u043d\u0430 \u0441\u0447\u0435\u0442\u043e\u0432, \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u0443\u0431\u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u043b\u0435\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u043c\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043e\u043d\u0442\u043e\u043b\u043e\u0433\u0438\u0438.<br \/>  \u041a\u0430\u043a\u043e\u0439-\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u044d\u0442\u043e\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043d\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0438\u0441\u0442\u0435\u043c \u0443\u0447\u0435\u0442\u0430 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0442\u0440\u0430\u0441\u043b\u0435\u0439 \u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043d\u0430 \u043c\u0435\u0441\u0442\u0430\u0445. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u0443\u043c\u043c\u044b \u043e\u0437\u0432\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0420\u0424\u0420\u0418\u0422 <a href=\"https:\/\/xn----8sbis2aqlf5f.xn--p1ai\/2\" rel=\"nofollow noopener noreferrer\">https:\/\/\u0438\u0442-\u0433\u0440\u0430\u043d\u0442\u044b.\u0440\u0444\/2<\/a>.<\/li>\n<li>\u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u044d\u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439: PostgreSQL, SQLAlchemy, FastAPI, Svelte\/Material.<\/li>\n<li>\u0414\u0435\u043f\u043b\u043e\u0439 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ansible.<\/li>\n<li>\u042f \u0442\u0430\u043a \u0432\u0438\u0436\u0443 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0430\u0440\u043a\u0434\u0430\u0443\u043d\u0430 \u0441\u043a\u043e\u0440\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0437\u0438\u0432\u0438\u0433 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 <a href=\"https:\/\/github.com\/nomhoi\/empire-erp\" rel=\"nofollow noopener noreferrer\">https:\/\/github.com\/nomhoi\/empire-erp<\/a>.<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/576286\/\"> https:\/\/habr.com\/ru\/articles\/576286\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439: <a href=\"https:\/\/github.com\/nomhoi\/empire-erp\" rel=\"nofollow noopener noreferrer\">https:\/\/github.com\/nomhoi\/empire-erp<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0443\u0447\u0435\u0442.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-406528","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406528"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406528\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}