Skip to content

Commit 3b71009

Browse files
authored
Merge pull request #17 from Data-Tech-International/release/3.4.0
Release/3.4.0
2 parents 62ff854 + 6e0d598 commit 3b71009

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+920
-443
lines changed

.github/workflows/v3-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout the code to specific branch
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
ref: ${{ github.event.inputs.branch }}
2222

2323
- name: Set up JDK
24-
uses: actions/setup-java@v3
24+
uses: actions/setup-java@v4
2525
with:
26-
distribution: 'zulu'
27-
java-version: '11'
26+
java-version: '17'
27+
distribution: 'temurin'
2828

2929
- name: Setup Android SDK
30-
uses: android-actions/setup-android@v2
30+
uses: android-actions/setup-android@v3
3131

3232
- name: Make gradlew executable
3333
run: chmod +x ./gradlew
@@ -117,7 +117,7 @@ jobs:
117117

118118
- name: Create Github Release
119119
id: create_release
120-
uses: softprops/action-gh-release@v1
120+
uses: softprops/action-gh-release@v2
121121
with:
122122
prerelease: ${{ env.BUILD_TARGET == 'debug' }}
123123
tag_name: ${{ env.VERSION_TAG }}

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [Unreleased]
6+
7+
### Added
8+
9+
- **TBD** Invoice catalog search
10+
- **TBD** TaxRates valid from date
11+
12+
### Fixed
13+
14+
- **TBD** Configuration response error handling
15+
16+
## [3.4.0] - 2024-07-22
17+
18+
### Added
19+
20+
- Support for Android 14
21+
- New language Serbian (BA) - `Serbian (Latin) (Bosnia and Herzegovina) (sr-Latn-BA)`
22+
23+
### Changed
24+
25+
- Display tax labels from all category types
26+
- Backup disabled in manifest
27+
- FR translations updated
28+
- Update build gradle version
29+
- Java compatibility version
30+
31+
### Fixed
32+
33+
- Certificate error fallback - PKCS12 key store mac invalid
34+
- Unhandled file import/export exceptions
35+
- Lint warnings for deprecated syntax
36+
- Layout issue for cashiers
37+
538
## [3.3.0] - 2023-03-03
639

740
### Added

app/build.gradle

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
apply plugin: 'com.android.application'
2-
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
4-
apply plugin: 'kotlin-kapt'
5-
apply plugin: 'realm-android'
6-
7-
// Add the Firebase Crashlytics plugin.
8-
apply plugin: 'com.google.firebase.crashlytics'
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
id 'kotlin-android-extensions'
5+
id 'kotlin-kapt'
6+
id 'realm-android'
7+
// Add the Firebase Crashlytics plugin.
8+
id 'com.google.firebase.crashlytics'
9+
}
910

1011
def versionMajor = 3
11-
def versionMinor = 3
12+
def versionMinor = 4
1213
def versionPatch = 0
1314
def versionBuild = 1
1415

@@ -17,19 +18,23 @@ def appVersionBuild = Integer.valueOf(System.env.GITHUB_RUN_NUMBER ?: versionBui
1718
android {
1819
namespace 'online.taxcore.pos'
1920

20-
compileSdkVersion 33
21+
compileSdk 34
2122

2223
bundle {
2324
language {
2425
enableSplit = false
2526
}
2627
}
2728

29+
buildFeatures {
30+
viewBinding true
31+
}
32+
2833
defaultConfig {
2934
applicationId "online.taxcore.pos"
3035

31-
minSdkVersion 24
32-
targetSdkVersion 33
36+
minSdk 24
37+
targetSdk 34
3338

3439
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch * 10 + appVersionBuild
3540
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
@@ -67,11 +72,11 @@ android {
6772
}
6873

6974
compileOptions {
70-
sourceCompatibility = 1.8
71-
targetCompatibility = 1.8
75+
sourceCompatibility JavaVersion.VERSION_17
76+
targetCompatibility JavaVersion.VERSION_17
7277
}
7378

74-
task printVersionInformation {
79+
tasks.register("printVersionInformation") {
7580
// Full version with build number
7681
println defaultConfig.versionName
7782
// Version without build number
@@ -92,19 +97,19 @@ dependencies {
9297

9398
implementation 'org.bouncycastle:bcpkix-jdk15on:1.67'
9499

95-
implementation "com.pawegio.kandroid:kandroid:0.8.7@aar"
100+
implementation 'com.github.pawegio:kandroid:0.8.7@aar'
96101

97102
//Android libs
98-
implementation "androidx.appcompat:appcompat:1.6.1"
103+
implementation "androidx.appcompat:appcompat:1.7.0"
99104
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
100-
implementation "androidx.preference:preference-ktx:1.2.0"
105+
implementation "androidx.preference:preference-ktx:1.2.1"
101106
implementation "androidx.security:security-crypto:1.0.0"
102-
implementation "androidx.core:core-ktx:1.9.0"
103-
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
107+
implementation "androidx.core:core-ktx:1.13.1"
108+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3"
104109

105110
implementation "com.android.support:design:$support"
106111
implementation "com.android.support.constraint:constraint-layout:2.0.4"
107-
implementation "com.google.android.material:material:1.8.0"
112+
implementation "com.google.android.material:material:1.12.0"
108113

109114
// dagger
110115
implementation "com.google.dagger:dagger:$dagger"
@@ -118,7 +123,7 @@ dependencies {
118123
implementation "com.squareup.retrofit2:retrofit:2.9.0"
119124
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
120125
implementation "com.squareup.okhttp3:logging-interceptor:4.9.2"
121-
implementation "com.google.code.gson:gson:2.8.9"
126+
implementation "com.google.code.gson:gson:2.10.1"
122127

123128
//Glide
124129
implementation "com.github.bumptech.glide:glide:4.12.0"
@@ -131,20 +136,18 @@ dependencies {
131136
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
132137
implementation 'com.afollestad.material-dialogs:datetime:3.3.0'
133138

134-
implementation 'com.chaos.view:pinview:1.4.3'
139+
implementation 'io.github.chaosleung:pinview:1.4.4'
135140

136141
implementation "org.greenrobot:eventbus:3.0.0"
137142
implementation 'io.github.inflationx:calligraphy3:3.1.1'
138143
implementation 'io.github.inflationx:viewpump:2.0.3'
139144
implementation "com.itextpdf:itextpdf:5.5.13.3"
140145
implementation "com.madgag:scpkix-jdk15on:1.47.0.1"
141-
implementation "net.cachapa.expandablelayout:expandablelayout:2.9.2"
142146

143147
implementation "com.github.vicpinm:krealmextensions:2.5.0"
144148

145149
// Kotlin
146-
implementation "org.jetbrains.anko:anko-commons:0.10.5"
147-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
150+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
148151

149152
implementation platform('com.google.firebase:firebase-bom:26.2.0')
150153

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<application
2424
android:name="online.taxcore.pos.TaxCoreApp"
25-
android:allowBackup="true"
25+
android:allowBackup="false"
2626
android:dataExtractionRules="@xml/data_extraction_rules"
2727
android:fullBackupContent="false"
2828
android:icon="@mipmap/ic_launcher"

app/src/main/java/online/taxcore/pos/TaxCoreApp.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class TaxCoreApp : Application(), HasActivityInjector {
3838
private fun initRealm() {
3939
Realm.init(this)
4040
val config = RealmConfiguration.Builder()
41-
.schemaVersion(1)
41+
.name("taxcore3.realm")
42+
.schemaVersion(2)
4243
.allowQueriesOnUiThread(true)
4344
.allowWritesOnUiThread(true)
44-
.name("taxcore3.realm")
4545
.build()
4646

4747
Realm.setDefaultConfiguration(config)

app/src/main/java/online/taxcore/pos/data/api/ApiService.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ import retrofit2.http.*
1010
interface ApiService {
1111

1212
@Headers(
13-
"Accept: application/json",
14-
"Content-Type: application/json"
13+
"Accept: application/json",
14+
"Content-Type: application/json"
1515
)
1616
@POST("api/v3/invoices")
1717
fun createInvoice(
18-
@Header("PAC") pacValue: String,
19-
@Body payload: InvoiceRequest
18+
@Header("PAC") pacValue: String,
19+
@Body payload: InvoiceRequest
2020
): Call<InvoiceResponse>
2121

2222
@Headers(
23-
"Accept: application/json",
24-
"Content-Type: application/json"
23+
"Accept: application/json",
24+
"Content-Type: application/json"
2525
)
2626
@GET("api/v3/status")
2727
fun getTaxes(
28-
@Header("PAC") pacValue: String
28+
@Header("PAC") pacValue: String
2929
): Call<StatusResponse>
3030

3131
@GET("api/v3/environment-parameters")
3232
fun fetchEnvParams(
33-
@Header("PAC") pacValue: String
33+
@Header("PAC") pacValue: String
3434
): Call<EnvResponse>
3535

3636
}

app/src/main/java/online/taxcore/pos/data/local/TaxesManager.kt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,6 @@ object TaxesManager {
4141
}
4242
}
4343

44-
fun addItemToDatabase(taxItem: TaxItem) {
45-
val realm = Realm.getDefaultInstance()
46-
try {
47-
realm.executeTransaction {
48-
// Add a appliedTaxes
49-
val taxes = realm.createObject<TaxesSettings>()
50-
with(taxes) {
51-
code = taxItem.label
52-
name = taxItem.name
53-
rate = taxItem.rate
54-
value = taxItem.value
55-
}
56-
addItem(0, taxes)
57-
}
58-
} catch (e: Exception) {
59-
print(e)
60-
} finally {
61-
realm.close()
62-
}
63-
}
64-
6544
fun getAllTaxes(): ArrayList<TaxesSettings> {
6645
val realm = Realm.getDefaultInstance()
6746
try {

app/src/main/java/online/taxcore/pos/data/models/Item.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ class Item {
44
var name: String = ""
55
var gtin: String? = null
66
var quantity: Double = 0.000
7-
var discount: Double = 0.00
87
var labels: List<String> = arrayListOf()
98
var unitPrice: Double = 0.00
109
var totalAmount: Double = 0.00

app/src/main/java/online/taxcore/pos/data/models/StatusResponse.kt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package online.taxcore.pos.data.models
22

33
import online.taxcore.pos.utils.TCUtil
44

5+
private const val AmountPerQuantityCategory = "2"
6+
57
class StatusResponse {
68
var sdcDateTime: String = ""
79
var supportedLanguages: List<String> = arrayListOf()
@@ -11,19 +13,27 @@ class StatusResponse {
1113
var currentTaxRates: CurrentTaxRate? = null
1214
var gsc: List<String> = arrayListOf()
1315

14-
fun getTaxLabels(countryCode: String = ""): List<TaxItem>? {
16+
fun getTaxLabels(countryCode: String = ""): List<TaxItem> {
1517
val currencySymbol = TCUtil.getCurrencyBy(countryCode)
16-
return currentTaxRates?.taxCategories?.map { taxCategory ->
18+
val mappedTaxLabels = arrayListOf<TaxItem>()
19+
20+
currentTaxRates?.taxCategories?.forEach { taxCategory ->
1721
val taxValue =
18-
if (taxCategory.categoryType == "AmountPerQuantity") currencySymbol else "%"
19-
20-
TaxItem(
21-
name = taxCategory.name,
22-
label = taxCategory.taxRates.first().label, // FIXME: 29.7.21. Map all taxRates
23-
rate = taxCategory.taxRates.first().rate, // FIXME: 29.7.21. Map all taxRates
24-
value = taxValue,
25-
)
22+
if (taxCategory.categoryType == AmountPerQuantityCategory) currencySymbol else "%"
23+
24+
taxCategory.taxRates.forEach { taxRate ->
25+
val tItem = TaxItem(
26+
name = taxCategory.name,
27+
label = taxRate.label,
28+
rate = taxRate.rate,
29+
value = taxValue,
30+
)
31+
32+
mappedTaxLabels.add(tItem)
33+
}
2634
}
35+
36+
return mappedTaxLabels
2737
}
2838

2939
fun hasErrors(): Boolean {
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package online.taxcore.pos.data.models
22

33
data class TaxItem(
4-
// val categoryType: Int,
54
val label: String,
6-
// val amount: Double,
75
val rate: Double,
8-
// val categoryName: String,
96
val name: String,
107
var value: String
118
)

0 commit comments

Comments
 (0)