Skip to content

Commit 4eaa8b6

Browse files
authored
Merge pull request #133 from openimis/fix/capitation-not-working
start date wrong for month
2 parents 16dc45a + aec6385 commit 4eaa8b6

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/openmis-module-test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,18 @@ jobs:
3838
- name: install linux packages
3939
run: |
4040
mkdir ./oldMain
41-
wget https://raw.githubusercontent.com/openimis/database_ms_sqlserver/main/Empty%20databases/openIMIS_ONLINE.sql -O oldMain/openIMIS_ONLINE.sql
42-
wget https://raw.githubusercontent.com/openimis/database_ms_sqlserver/main/Demo%20database/openIMIS_demo_ONLINE.sql -O oldMain/openIMIS_demo_ONLINE.sql
41+
git clone --depth 1 --branch main https://github.com/openimis/database_ms_sqlserver ./oldMain
42+
cd oldMain
43+
bash concatenate_files.sh
44+
cd ..
4345
mkdir ./1.42
4446
wget https://raw.githubusercontent.com/openimis/database_ms_sqlserver/v1.4.2/Empty%20databases/openIMIS_ONLINE.sql -O 1.42/openIMIS_ONLINE.sql
4547
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
4648
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
4749
sudo apt-get update
4850
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools build-essential dialog apt-utils unixodbc-dev jq -y
4951
python -m pip install --upgrade pip
50-
- name: DB migration 1.42
52+
- name: DB migration 1.4.2
5153
run: |
5254
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -Q 'DROP DATABASE IF EXISTS imis_1_4_2'
5355
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -Q 'CREATE DATABASE imis_1_4_2'
@@ -70,8 +72,7 @@ jobs:
7072
run: |
7173
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -Q 'DROP DATABASE IF EXISTS imis_main'
7274
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -Q 'CREATE DATABASE imis_main'
73-
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -d imis_main -i oldMain/openIMIS_ONLINE.sql | grep . | uniq -c
74-
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -d imis_main -i oldMain/openIMIS_demo_ONLINE.sql | grep . | uniq -c
75+
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -d imis_main -i "oldMain/output/fullDemoDatabase.sql" | grep . | uniq -cc
7576
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -d imis_main -i "new/output/fullMigrationScipt.sql" | grep . | uniq -c
7677
7778

sql/stored_procedures/uspCreateCapitationPaymentReportData.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ BEGIN
7575

7676

7777
set @LastDay = EOMONTH(@startDateMonth, 0)
78-
SELECT @FirstDay = CASE @RP WHEN 'M' THEN @FirstDay
78+
SELECT @FirstDay = CASE @RP WHEN 'M' THEN @startDateMonth
7979
WHEN 'Q' THEN @startDateQuarter
8080
WHEN 'Y' THEN @startDateYear END
8181

0 commit comments

Comments
 (0)