Skip to content

Commit

Permalink
Merge #1892
Browse files Browse the repository at this point in the history
1892: Fix data period total r=jniles

fix(Data Development) 
- Update data for the table period_total in development-build.sql 

test(Update Regression test) 
- Update and Reset data for regression test - Expected the balance sheet report formule
 - Restaure the request in extra.js

closes #1891
  • Loading branch information
bors[bot] committed Jul 28, 2017
2 parents efa9811 + 664e4d8 commit 5a04825
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/controllers/finance/accounts/extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function getPeriodAccountBalanceUntilDate(accountId, date, fiscalYearId) {
const periodCondition = `
(period.number = 0
OR
period.end_date < DATE(?))
DATE(period.end_date) < DATE(?))
`;

const sql = `
Expand Down
2 changes: 1 addition & 1 deletion test/development-build.sql
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ INSERT INTO `period` (`id`, `fiscal_year_id`, `number`, `start_date`, `end_date`
--

/*!40000 ALTER TABLE `period_total` DISABLE KEYS */;
INSERT INTO `period_total` (`enterprise_id`, `fiscal_year_id`, `period_id`, `account_id`, `credit`, `debit`, `locked`) VALUES (1,1,1,190,0.0000,2000.0000,0),(1,1,2,172,3.4900,4.5648,0),(1,1,2,190,70.0000,3.4900,0),(1,1,2,191,3.4900,3.4900,0),(1,1,2,194,3.4900,3.4900,0),(1,1,2,217,0.0000,20.0000,0),(1,1,2,218,0.0000,50.0000,0),(1,1,2,242,3.6500,0.0000,0),(1,1,2,243,0.9148,0.0000,0),(1,1,3,172,1.0748,0.8000,0),(1,1,3,176,0.0000,1.9371,0),(1,1,3,190,70.0000,1.0700,0),(1,1,3,191,1.0700,1.0700,0),(1,1,3,194,1.0700,1.0700,0),(1,1,3,217,0.0000,20.0000,0),(1,1,3,218,0.0000,50.0000,0),(1,1,3,222,0.0000,0.0048,0),(1,1,3,242,1.4271,0.0000,0),(1,1,3,243,1.3100,0.0000,0),(1,1,4,172,0.8000,3.3200,0),(1,1,4,176,0.0000,0.0300,0),(1,1,4,190,70.0000,0.8000,0),(1,1,4,191,0.8000,0.8000,0),(1,1,4,194,0.8000,0.8000,0),(1,1,4,217,0.0000,20.0000,0),(1,1,4,218,0.0000,50.0000,0),(1,1,4,242,0.0300,0.0000,0),(1,1,4,243,3.3200,0.0000,0),(1,1,5,172,3.3200,0.0000,0),(1,1,5,176,0.0000,3.8880,0),(1,1,5,190,70.0000,3.3200,0),(1,1,5,191,3.3200,3.3200,0),(1,1,5,194,3.3200,3.3200,0),(1,1,5,217,0.0000,20.0000,0),(1,1,5,218,0.0000,50.0000,0),(1,1,5,242,3.8880,0.0000,0),(1,1,6,176,22.9414,79.9318,0),(1,1,6,190,70.0000,22.9400,0),(1,1,6,191,22.9400,22.9400,0),(1,1,6,194,22.9400,22.9400,0),(1,1,6,217,0.0000,20.0000,0),(1,1,6,218,0.0000,50.0000,0),(1,1,6,222,0.0000,0.0014,0),(1,1,6,242,53.1182,0.0000,0),(1,1,6,243,26.8136,0.0000,0),(1,1,7,176,1.6380,0.6296,0),(1,1,7,190,70.0000,1.6400,0),(1,1,7,191,1.6400,1.6400,0),(1,1,7,194,1.6400,1.6400,0),(1,1,7,217,0.0000,20.0000,0),(1,1,7,218,0.0000,50.0000,0),(1,1,7,242,0.6296,0.0000,0),(1,1,7,262,0.0020,0.0000,0),(1,1,8,172,0.3029,0.3029,0),(1,1,8,176,0.0000,0.3600,0),(1,1,8,190,70.0000,0.3000,0),(1,1,8,191,0.3000,0.3000,0),(1,1,8,194,0.3000,0.3000,0),(1,1,8,217,0.0000,20.0000,0),(1,1,8,218,0.0000,50.0000,0),(1,1,8,222,0.0000,0.0029,0),(1,1,8,242,0.6629,0.0000,0),(1,1,9,172,0.0000,1.5100,0),(1,1,9,176,0.1600,0.3000,0),(1,1,9,190,70.0000,0.1600,0),(1,1,9,191,0.1600,0.1600,0),(1,1,9,194,0.1600,0.1600,0),(1,1,9,217,0.0000,20.0000,0),(1,1,9,218,0.0000,50.0000,0),(1,1,9,242,1.8100,0.0000,0),(1,1,10,172,1.5100,0.0000,0),(1,1,10,176,0.0000,1.6960,0),(1,1,10,190,70.0000,1.5100,0),(1,1,10,191,1.5100,1.5100,0),(1,1,10,194,1.5100,1.5100,0),(1,1,10,217,0.0000,20.0000,0),(1,1,10,218,0.0000,50.0000,0),(1,1,10,242,1.6960,0.0000,0),(1,1,11,176,0.3000,3.6546,0),(1,1,11,190,70.0000,0.3000,0),(1,1,11,191,0.3000,0.3000,0),(1,1,11,194,0.3000,0.3000,0),(1,1,11,217,0.0000,20.0000,0),(1,1,11,218,0.0000,50.0000,0),(1,1,11,242,3.6546,0.0000,0),(1,1,12,176,1.9371,5.1116,0),(1,1,12,190,70.0000,1.9400,0),(1,1,12,191,1.9400,1.9400,0),(1,1,12,194,1.9400,1.9400,0),(1,1,12,217,0.0000,20.0000,0),(1,1,12,218,0.0000,50.0000,0),(1,1,12,242,2.4716,0.0000,0),(1,1,12,243,2.6400,0.0000,0),(1,1,12,262,0.0029,0.0000,0),(1,1,13,172,0.0000,1.6955,0),(1,1,13,176,2.2500,0.3800,0),(1,1,13,190,70.0000,2.2500,0),(1,1,13,191,2.2500,2.2500,0),(1,1,13,194,2.2500,2.2500,0),(1,1,13,217,0.0000,20.0000,0),(1,1,13,218,0.0000,50.0000,0),(1,1,13,242,2.0755,0.0000,0),(1,2,15,172,10.4977,12.1932,0),(1,2,15,176,29.2265,97.9187,0),(1,2,15,190,840.0000,2039.7200,0),(1,2,15,191,39.7200,39.7200,0),(1,2,15,194,39.7200,39.7200,0),(1,2,15,283,110.1168,840.0091,0),(1,2,16,172,1.6955,0.0900,0),(1,2,16,176,0.0000,3.3034,0),(1,2,16,190,70.0000,1.7000,0),(1,2,16,191,1.7000,1.7000,0),(1,2,16,194,1.7000,1.7000,0),(1,2,16,217,0.0000,20.0000,0),(1,2,16,218,0.0000,50.0000,0),(1,2,16,242,3.3934,0.0000,0),(1,2,16,262,0.0045,0.0000,0),(1,2,17,176,0.0300,3.3064,0),(1,2,17,190,70.0000,0.0300,0),(1,2,17,191,0.0300,0.0300,0),(1,2,17,194,0.0300,0.0300,0),(1,2,17,217,0.0000,20.0000,0),(1,2,17,218,0.0000,50.0000,0),(1,2,17,242,3.3064,0.0000,0),(1,2,18,172,0.0900,0.0000,0),(1,2,18,175,0.0000,0.7885,0),(1,2,18,190,70.0000,0.0900,0),(1,2,18,191,0.0900,0.0900,0),(1,2,18,194,0.0900,0.0900,0),(1,2,18,217,0.0000,20.0000,0),(1,2,18,218,0.0000,50.0000,0),(1,2,18,242,0.7885,0.0000,0),(1,2,19,172,0.0000,1.5285,0),(1,2,19,176,2.8870,0.0850,0),(1,2,19,190,70.0000,2.8900,0),(1,2,19,191,2.8900,2.8900,0),(1,2,19,194,2.8900,2.8900,0),(1,2,19,217,0.0000,20.0000,0),(1,2,19,218,0.0000,50.0000,0),(1,2,19,242,1.6135,0.0000,0),(1,2,19,262,0.0030,0.0000,0),(1,2,20,172,1.5285,0.3700,0),(1,2,20,176,0.0000,0.6451,0),(1,2,20,190,70.0000,1.5300,0),(1,2,20,191,1.5300,1.5300,0),(1,2,20,194,1.5300,1.5300,0),(1,2,20,217,0.0000,20.0000,0),(1,2,20,218,0.0000,50.0000,0),(1,2,20,242,1.0151,0.0000,0),(1,2,20,262,0.0015,0.0000,0),(1,2,21,176,0.4696,6.2928,0),(1,2,21,190,70.0000,0.4700,0),(1,2,21,191,0.4700,0.4700,0),(1,2,21,194,0.4700,0.4700,0),(1,2,21,217,0.0000,20.0000,0),(1,2,21,218,0.0000,50.0000,0),(1,2,21,242,6.2928,0.0000,0),(1,2,21,262,0.0004,0.0000,0),(1,2,22,172,0.0000,0.6100,0),(1,2,22,176,0.8400,0.3000,0),(1,2,22,190,70.0000,0.8400,0),(1,2,22,191,0.8400,0.8400,0),(1,2,22,194,0.8400,0.8400,0),(1,2,22,217,0.0000,20.0000,0),(1,2,22,218,0.0000,50.0000,0),(1,2,22,242,0.9100,0.0000,0),(1,2,23,175,0.0000,0.4000,0),(1,2,23,176,3.6100,4.4600,0),(1,2,23,190,70.0000,3.6100,0),(1,2,23,191,3.6100,3.6100,0),(1,2,23,194,3.6100,3.6100,0),(1,2,23,217,0.0000,20.0000,0),(1,2,23,218,0.0000,50.0000,0),(1,2,23,242,0.6600,0.0000,0),(1,2,23,243,4.2000,0.0000,0),(1,2,24,176,56.9904,1.4635,0),(1,2,24,190,70.0000,56.9900,0),(1,2,24,191,56.9900,56.9900,0),(1,2,24,194,56.9900,56.9900,0),(1,2,24,217,0.0000,20.0000,0),(1,2,24,218,0.0000,50.0000,0),(1,2,24,222,0.0000,0.0004,0),(1,2,24,242,1.4635,0.0000,0),(1,2,25,176,0.6000,0.6000,0),(1,2,25,177,0.0000,4.5200,0),(1,2,25,190,70.0000,0.6000,0),(1,2,25,191,0.6000,0.6000,0),(1,2,25,194,0.6000,0.6000,0),(1,2,25,217,0.0000,20.0000,0),(1,2,25,218,0.0000,50.0000,0),(1,2,25,242,5.1200,0.0000,0),(1,2,26,176,0.3548,1.2148,0),(1,2,26,190,70.0000,0.3500,0),(1,2,26,191,0.3500,0.3500,0),(1,2,26,194,0.3500,0.3500,0),(1,2,26,217,0.0000,20.0000,0),(1,2,26,218,0.0000,50.0000,0),(1,2,26,222,0.0000,0.0048,0),(1,2,26,242,1.2148,0.0000,0),(1,2,27,172,0.0000,25.8038,0),(1,2,27,176,0.3000,0.5400,0),(1,2,27,190,70.0000,0.3000,0),(1,2,27,191,0.3000,0.3000,0),(1,2,27,194,0.3000,0.3000,0),(1,2,27,217,0.0000,20.0000,0),(1,2,27,218,0.0000,50.0000,0),(1,2,27,242,1.3438,0.0000,0),(1,2,27,243,25.0000,0.0000,0),(1,3,29,172,13.8117,40.5955,0),(1,3,29,175,0.0000,1.1885,0),(1,3,29,176,95.3083,120.1297,0),(1,3,29,177,0.0000,4.5200,0),(1,3,29,190,1680.0000,2109.1200,0),(1,3,29,191,109.1200,109.1200,0),(1,3,29,194,109.1200,109.1200,0),(1,3,29,283,166.4480,1680.0143,0),(1,1,1,91,2000.0000,0.0000,0),(1,2,15,91,2000.0000,0.0000,0),(1,3,29,91,2000.0000,0.0000,0), (1, 1, 2, 285, 30.0000, 20.0000, 0), (1, 1, 3, 285, 30.0000, 20.0000, 0), (1, 1, 4, 285, 30.0000, 20.0000, 0), (1, 1, 5, 285, 30.0000, 20.0000, 0), (1, 1, 6, 285, 30.0000, 20.0000, 0), (1, 1, 7, 285, 30.0000, 20.0000, 0), (1, 1, 8, 285, 30.0000, 20.0000, 0), (1, 1, 9, 285, 30.0000, 20.0000, 0), (1, 1, 10, 285, 30.0000, 20.0000, 0), (1, 1, 11, 285, 30.0000, 20.0000, 0), (1, 1, 12, 285, 30.0000, 20.0000, 0), (1, 1, 13, 285, 30.0000, 20.0000, 0), (1, 2, 15, 285, 360.0000, 240.0000, 0), (1, 2, 16, 285, 30.0000, 20.0000, 0), (1, 2, 17, 285, 30.0000, 20.0000, 0), (1, 2, 18, 285, 30.0000, 20.0000, 0), (1, 2, 19, 285, 30.0000, 20.0000, 0), (1, 2, 20, 285, 30.0000, 20.0000, 0), (1, 2, 21, 285, 30.0000, 20.0000, 0), (1, 2, 22, 285, 30.0000, 20.0000, 0), (1, 2, 23, 285, 30.0000, 20.0000, 0), (1, 2, 24, 285, 30.0000, 20.0000, 0), (1, 2, 25, 285, 30.0000, 20.0000, 0), (1, 2, 26, 285, 30.0000, 20.0000, 0), (1, 2, 27, 285, 30.0000, 20.0000, 0), (1, 3, 29, 285, 780.0000, 480.0000, 0), (1, 1, 2, 284, 60.0000, 50.0000, 0), (1, 1, 3, 284, 60.0000, 50.0000, 0), (1, 1, 4, 284, 60.0000, 50.0000, 0), (1, 1, 5, 284, 60.0000, 50.0000, 0), (1, 1, 6, 284, 60.0000, 50.0000, 0), (1, 1, 7, 284, 60.0000, 50.0000, 0), (1, 1, 8, 284, 60.0000, 50.0000, 0), (1, 1, 9, 284, 60.0000, 50.0000, 0), (1, 1, 10, 284, 60.0000, 50.0000, 0), (1, 1, 11, 284, 60.0000, 50.0000, 0), (1, 1, 12, 284, 60.0000, 50.0000, 0), (1, 1, 13, 284, 60.0000, 50.0000, 0), (1, 2, 15, 284, 720.0000, 600.0000, 0), (1, 2, 16, 284, 60.0000, 50.0000, 0), (1, 2, 17, 284, 60.0000, 50.0000, 0), (1, 2, 18, 284, 60.0000, 50.0000, 0), (1, 2, 19, 284, 60.0000, 50.0000, 0), (1, 2, 20, 284, 60.0000, 50.0000, 0),(1, 2, 21, 284, 60.0000, 50.0000, 0),(1, 2, 22, 284, 60.0000, 50.0000, 0),(1, 2, 23, 284, 60.0000, 50.0000, 0),(1, 2, 24, 284, 60.0000, 50.0000, 0),(1, 2, 25, 284, 60.0000, 50.0000, 0), (1, 2, 26, 284, 60.0000, 50.0000, 0), (1, 2, 27, 284, 60.0000, 50.0000, 0), (1, 3, 29, 284, 1440.0000, 1200.0000, 0);
INSERT INTO `period_total` (`enterprise_id`, `fiscal_year_id`, `period_id`, `account_id`, `credit`, `debit`, `locked`) VALUES (1,1,1,190,0.0000,2000.0000,0),(1,1,2,172,3.4900,4.5648,0),(1,1,2,190,70.0000,3.4900,0),(1,1,2,191,3.4900,3.4900,0),(1,1,2,194,3.4900,3.4900,0),(1,1,2,217,0.0000,30.0000,0),(1,1,2,218,0.0000,60.0000,0),(1,1,2,242,3.6500,0.0000,0),(1,1,2,243,0.9148,0.0000,0),(1,1,3,172,1.0748,0.8000,0),(1,1,3,176,0.0000,1.9371,0),(1,1,3,190,70.0000,1.0700,0),(1,1,3,191,1.0700,1.0700,0),(1,1,3,194,1.0700,1.0700,0),(1,1,3,217,0.0000,30.0000,0),(1,1,3,218,0.0000,60.0000,0),(1,1,3,222,0.0000,0.0048,0),(1,1,3,242,1.4271,0.0000,0),(1,1,3,243,1.3100,0.0000,0),(1,1,4,172,0.8000,3.3200,0),(1,1,4,176,0.0000,0.0300,0),(1,1,4,190,70.0000,0.8000,0),(1,1,4,191,0.8000,0.8000,0),(1,1,4,194,0.8000,0.8000,0),(1,1,4,217,0.0000,30.0000,0),(1,1,4,218,0.0000,60.0000,0),(1,1,4,242,0.0300,0.0000,0),(1,1,4,243,3.3200,0.0000,0),(1,1,5,172,3.3200,0.0000,0),(1,1,5,176,0.0000,3.8880,0),(1,1,5,190,70.0000,3.3200,0),(1,1,5,191,3.3200,3.3200,0),(1,1,5,194,3.3200,3.3200,0),(1,1,5,217,0.0000,30.0000,0),(1,1,5,218,0.0000,60.0000,0),(1,1,5,242,3.8880,0.0000,0),(1,1,6,176,22.9414,79.9318,0),(1,1,6,190,70.0000,22.9400,0),(1,1,6,191,22.9400,22.9400,0),(1,1,6,194,22.9400,22.9400,0),(1,1,6,217,0.0000,30.0000,0),(1,1,6,218,0.0000,60.0000,0),(1,1,6,222,0.0000,0.0014,0),(1,1,6,242,53.1182,0.0000,0),(1,1,6,243,26.8136,0.0000,0),(1,1,7,176,1.6380,0.6296,0),(1,1,7,190,70.0000,1.6400,0),(1,1,7,191,1.6400,1.6400,0),(1,1,7,194,1.6400,1.6400,0),(1,1,7,217,0.0000,30.0000,0),(1,1,7,218,0.0000,60.0000,0),(1,1,7,242,0.6296,0.0000,0),(1,1,7,262,0.0020,0.0000,0),(1,1,8,172,0.3029,0.3029,0),(1,1,8,176,0.0000,0.3600,0),(1,1,8,190,70.0000,0.3000,0),(1,1,8,191,0.3000,0.3000,0),(1,1,8,194,0.3000,0.3000,0),(1,1,8,217,0.0000,30.0000,0),(1,1,8,218,0.0000,60.0000,0),(1,1,8,222,0.0000,0.0029,0),(1,1,8,242,0.6629,0.0000,0),(1,1,9,172,0.0000,1.5100,0),(1,1,9,176,0.1600,0.3000,0),(1,1,9,190,70.0000,0.1600,0),(1,1,9,191,0.1600,0.1600,0),(1,1,9,194,0.1600,0.1600,0),(1,1,9,217,0.0000,30.0000,0),(1,1,9,218,0.0000,60.0000,0),(1,1,9,242,1.8100,0.0000,0),(1,1,10,172,1.5100,0.0000,0),(1,1,10,176,0.0000,1.6960,0),(1,1,10,190,70.0000,1.5100,0),(1,1,10,191,1.5100,1.5100,0),(1,1,10,194,1.5100,1.5100,0),(1,1,10,217,0.0000,30.0000,0),(1,1,10,218,0.0000,60.0000,0),(1,1,10,242,1.6960,0.0000,0),(1,1,11,176,0.3000,3.6546,0),(1,1,11,190,70.0000,0.3000,0),(1,1,11,191,0.3000,0.3000,0),(1,1,11,194,0.3000,0.3000,0),(1,1,11,217,0.0000,30.0000,0),(1,1,11,218,0.0000,60.0000,0),(1,1,11,242,3.6546,0.0000,0),(1,1,12,176,1.9371,5.1116,0),(1,1,12,190,70.0000,1.9400,0),(1,1,12,191,1.9400,1.9400,0),(1,1,12,194,1.9400,1.9400,0),(1,1,12,217,0.0000,30.0000,0),(1,1,12,218,0.0000,60.0000,0),(1,1,12,242,2.4716,0.0000,0),(1,1,12,243,2.6400,0.0000,0),(1,1,12,262,0.0029,0.0000,0),(1,1,13,172,0.0000,1.6955,0),(1,1,13,176,2.2500,0.3800,0),(1,1,13,190,70.0000,2.2500,0),(1,1,13,191,2.2500,2.2500,0),(1,1,13,194,2.2500,2.2500,0),(1,1,13,217,0.0000,30.0000,0),(1,1,13,218,0.0000,60.0000,0),(1,1,13,242,2.0755,0.0000,0),(1,2,15,172,10.4977,12.1932,0),(1,2,15,176,29.2265,97.9187,0),(1,2,15,190,840.0000,2039.7200,0),(1,2,15,191,39.7200,39.7200,0),(1,2,15,194,39.7200,39.7200,0),(1,2,15,283,110.1168,1080.0091,0),(1,2,16,172,1.6955,0.0900,0),(1,2,16,176,0.0000,3.3034,0),(1,2,16,190,70.0000,1.7000,0),(1,2,16,191,1.7000,1.7000,0),(1,2,16,194,1.7000,1.7000,0),(1,2,16,217,0.0000,30.0000,0),(1,2,16,218,0.0000,60.0000,0),(1,2,16,242,3.3934,0.0000,0),(1,2,16,262,0.0045,0.0000,0),(1,2,17,176,0.0300,3.3064,0),(1,2,17,190,70.0000,0.0300,0),(1,2,17,191,0.0300,0.0300,0),(1,2,17,194,0.0300,0.0300,0),(1,2,17,217,0.0000,30.0000,0),(1,2,17,218,0.0000,60.0000,0),(1,2,17,242,3.3064,0.0000,0),(1,2,18,172,0.0900,0.0000,0),(1,2,18,175,0.0000,0.7885,0),(1,2,18,190,70.0000,0.0900,0),(1,2,18,191,0.0900,0.0900,0),(1,2,18,194,0.0900,0.0900,0),(1,2,18,217,0.0000,30.0000,0),(1,2,18,218,0.0000,60.0000,0),(1,2,18,242,0.7885,0.0000,0),(1,2,19,172,0.0000,1.5285,0),(1,2,19,176,2.8870,0.0850,0),(1,2,19,190,70.0000,2.8900,0),(1,2,19,191,2.8900,2.8900,0),(1,2,19,194,2.8900,2.8900,0),(1,2,19,217,0.0000,30.0000,0),(1,2,19,218,0.0000,60.0000,0),(1,2,19,242,1.6135,0.0000,0),(1,2,19,262,0.0030,0.0000,0),(1,2,20,172,1.5285,0.3700,0),(1,2,20,176,0.0000,0.6451,0),(1,2,20,190,70.0000,1.5300,0),(1,2,20,191,1.5300,1.5300,0),(1,2,20,194,1.5300,1.5300,0),(1,2,20,217,0.0000,30.0000,0),(1,2,20,218,0.0000,60.0000,0),(1,2,20,242,1.0151,0.0000,0),(1,2,20,262,0.0015,0.0000,0),(1,2,21,176,0.4696,6.2928,0),(1,2,21,190,70.0000,0.4700,0),(1,2,21,191,0.4700,0.4700,0),(1,2,21,194,0.4700,0.4700,0),(1,2,21,217,0.0000,30.0000,0),(1,2,21,218,0.0000,60.0000,0),(1,2,21,242,6.2928,0.0000,0),(1,2,21,262,0.0004,0.0000,0),(1,2,22,172,0.0000,0.6100,0),(1,2,22,176,0.8400,0.3000,0),(1,2,22,190,70.0000,0.8400,0),(1,2,22,191,0.8400,0.8400,0),(1,2,22,194,0.8400,0.8400,0),(1,2,22,217,0.0000,30.0000,0),(1,2,22,218,0.0000,60.0000,0),(1,2,22,242,0.9100,0.0000,0),(1,2,23,175,0.0000,0.4000,0),(1,2,23,176,3.6100,4.4600,0),(1,2,23,190,70.0000,3.6100,0),(1,2,23,191,3.6100,3.6100,0),(1,2,23,194,3.6100,3.6100,0),(1,2,23,217,0.0000,30.0000,0),(1,2,23,218,0.0000,60.0000,0),(1,2,23,242,0.6600,0.0000,0),(1,2,23,243,4.2000,0.0000,0),(1,2,24,176,56.9904,1.4635,0),(1,2,24,190,70.0000,56.9900,0),(1,2,24,191,56.9900,56.9900,0),(1,2,24,194,56.9900,56.9900,0),(1,2,24,217,0.0000,30.0000,0),(1,2,24,218,0.0000,60.0000,0),(1,2,24,222,0.0000,0.0004,0),(1,2,24,242,1.4635,0.0000,0),(1,2,25,176,0.6000,0.6000,0),(1,2,25,177,0.0000,4.5200,0),(1,2,25,190,70.0000,0.6000,0),(1,2,25,191,0.6000,0.6000,0),(1,2,25,194,0.6000,0.6000,0),(1,2,25,217,0.0000,30.0000,0),(1,2,25,218,0.0000,60.0000,0),(1,2,25,242,5.1200,0.0000,0),(1,2,26,176,0.3548,1.2148,0),(1,2,26,190,70.0000,0.3500,0),(1,2,26,191,0.3500,0.3500,0),(1,2,26,194,0.3500,0.3500,0),(1,2,26,217,0.0000,30.0000,0),(1,2,26,218,0.0000,60.0000,0),(1,2,26,222,0.0000,0.0048,0),(1,2,26,242,1.2148,0.0000,0),(1,2,27,172,0.0000,25.8038,0),(1,2,27,176,0.3000,0.5400,0),(1,2,27,190,70.0000,0.3000,0),(1,2,27,191,0.3000,0.3000,0),(1,2,27,194,0.3000,0.3000,0),(1,2,27,217,0.0000,30.0000,0),(1,2,27,218,0.0000,60.0000,0),(1,2,27,242,1.3438,0.0000,0),(1,2,27,243,25.0000,0.0000,0),(1,3,29,172,13.8117,40.5955,0),(1,3,29,175,0.0000,1.1885,0),(1,3,29,176,95.3083,120.1297,0),(1,3,29,177,0.0000,4.5200,0),(1,3,29,190,1680.0000,2109.1200,0),(1,3,29,191,109.1200,109.1200,0),(1,3,29,194,109.1200,109.1200,0),(1,3,29,283,166.448,2160.0143,0),(1,1,1,91,2000.0000,0.0000,0),(1,2,15,91,2000.0000,0.0000,0),(1,3,29,91,2000.0000,0.0000,0), (1, 1, 2, 285, 30.0000, 20.0000, 0), (1, 1, 3, 285, 30.0000, 20.0000, 0), (1, 1, 4, 285, 30.0000, 20.0000, 0), (1, 1, 5, 285, 30.0000, 20.0000, 0), (1, 1, 6, 285, 30.0000, 20.0000, 0), (1, 1, 7, 285, 30.0000, 20.0000, 0), (1, 1, 8, 285, 30.0000, 20.0000, 0), (1, 1, 9, 285, 30.0000, 20.0000, 0), (1, 1, 10, 285, 30.0000, 20.0000, 0), (1, 1, 11, 285, 30.0000, 20.0000, 0), (1, 1, 12, 285, 30.0000, 20.0000, 0), (1, 1, 13, 285, 30.0000, 20.0000, 0), (1, 2, 15, 285, 360.0000, 240.0000, 0), (1, 2, 16, 285, 30.0000, 20.0000, 0), (1, 2, 17, 285, 30.0000, 20.0000, 0), (1, 2, 18, 285, 30.0000, 20.0000, 0), (1, 2, 19, 285, 30.0000, 20.0000, 0), (1, 2, 20, 285, 30.0000, 20.0000, 0), (1, 2, 21, 285, 30.0000, 20.0000, 0), (1, 2, 22, 285, 30.0000, 20.0000, 0), (1, 2, 23, 285, 30.0000, 20.0000, 0), (1, 2, 24, 285, 30.0000, 20.0000, 0), (1, 2, 25, 285, 30.0000, 20.0000, 0), (1, 2, 26, 285, 30.0000, 20.0000, 0), (1, 2, 27, 285, 30.0000, 20.0000, 0), (1, 3, 29, 285, 720.0000, 480.0000, 0), (1, 1, 2, 284, 60.0000, 50.0000, 0), (1, 1, 3, 284, 60.0000, 50.0000, 0), (1, 1, 4, 284, 60.0000, 50.0000, 0), (1, 1, 5, 284, 60.0000, 50.0000, 0), (1, 1, 6, 284, 60.0000, 50.0000, 0), (1, 1, 7, 284, 60.0000, 50.0000, 0), (1, 1, 8, 284, 60.0000, 50.0000, 0), (1, 1, 9, 284, 60.0000, 50.0000, 0), (1, 1, 10, 284, 60.0000, 50.0000, 0), (1, 1, 11, 284, 60.0000, 50.0000, 0), (1, 1, 12, 284, 60.0000, 50.0000, 0), (1, 1, 13, 284, 60.0000, 50.0000, 0), (1, 2, 15, 284, 720.0000, 600.0000, 0), (1, 2, 16, 284, 60.0000, 50.0000, 0), (1, 2, 17, 284, 60.0000, 50.0000, 0), (1, 2, 18, 284, 60.0000, 50.0000, 0), (1, 2, 19, 284, 60.0000, 50.0000, 0), (1, 2, 20, 284, 60.0000, 50.0000, 0),(1, 2, 21, 284, 60.0000, 50.0000, 0),(1, 2, 22, 284, 60.0000, 50.0000, 0),(1, 2, 23, 284, 60.0000, 50.0000, 0),(1, 2, 24, 284, 60.0000, 50.0000, 0),(1, 2, 25, 284, 60.0000, 50.0000, 0), (1, 2, 26, 284, 60.0000, 50.0000, 0), (1, 2, 27, 284, 60.0000, 50.0000, 0), (1, 3, 29, 284, 1440.0000, 1200.0000, 0);

/*!40000 ALTER TABLE `period_total` ENABLE KEYS */;

Expand Down
11 changes: 8 additions & 3 deletions test/temporary-financial-reports/balanceSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ describe('Balance Sheet Report', () => {
*/
const totalAssets = 6.43;
const totalLiabilities = 0;
const totalEquity = -1270.11; // equity has a creditor sold (negative)
const totalEquity = -1030.11; // equity has a creditor sold (negative)
const totalRevenue = -56.33; // revenue has a creditor sold (negative)
const totalExpense = 840.01; // expense has a debtor sold (positive)
const totalExpense = 1080.01; // expense has a debtor sold (positive)

result2016 = totalEquity + totalRevenue + totalExpense;

Expand All @@ -53,11 +53,16 @@ describe('Balance Sheet Report', () => {
expect(Number((report.equity.totals.balance || 0).toFixed(2))).to.equal(totalEquity);
expect(Number((report.revenue.totals.balance || 0).toFixed(2))).to.equal(totalRevenue);
expect(Number((report.expense.totals.balance || 0).toFixed(2))).to.equal(totalExpense);

//Expect result2016
const expect2016 = Number(((report.equity.totals.balance + report.revenue.totals.balance + report.expense.totals.balance) || 0).toFixed(2));

expect(Number((expect2016 || 0).toFixed(2))).to.equal(Number((result2016 || 0).toFixed(2)));
});
});

it('Returns expected aggregate results for the start of fiscal year 2017', () => {
const totalAssets = -53.57;
const totalAssets = 6.43;
const totalLiabilities = 0;
const totalRevenue = 0; // revenue has a creditor sold (negative)
const totalExpense = 0; // expense has a debtor sold (positive)
Expand Down
4 changes: 2 additions & 2 deletions test/temporary-financial-reports/incomeExpense.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Income expense Report', () => {
it('Returns correct data for a one period january 2016', () => {
// see server/controllers/finance/reports/incomeExpense/index.js, sumIncomeExpenseAccounts method
const incomeBalance = 3.3979;
const expenseBalance = 70;
const expenseBalance = 90;

// see server/controllers/finance/reports/incomeExpense/index.js, sumIncomeExpenseAccounts method
const incomesLength = 2;
Expand All @@ -76,7 +76,7 @@ describe('Income expense Report', () => {
it('Returns correct data for all 2016 periods', () => {
// see server/controllers/finance/periodTotal/index.js, getAccountsBalance method
const incomeBalance = 56.3312;
const expenseBalance = 840.0052;
const expenseBalance = 1080.0052;

// see server/controllers/finance/periodTotal/index.js, getAccountsBalances method
const incomesLength = 3;
Expand Down

0 comments on commit 5a04825

Please sign in to comment.