Skip to content

Commit 35713fd

Browse files
authored
Merge pull request #615 from evotor/STDEV-24098
STDEV-24098 Добавление новой ТГ FURSLP_MARKED
2 parents 14ffa83 + 428c511 commit 35713fd

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

src/main/java/ru/evotor/framework/features/FeaturesApi.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,13 @@ object FeaturesApi {
343343
*/
344344
fun isVat22Active(context: Context) = isFeatureActive(context, FeaturesContract.PATH_VAT22)
345345

346+
/**
347+
* Проверяет, активна ли функция "Маркировка меховых изделий (КМ)" на данном терминале
348+
*
349+
* @return `true` если функция активна; `false` если функция не активна.
350+
*/
351+
fun isFursLpMarkActive(context: Context) = isFeatureActive(context, FeaturesContract.PATH_FURSLP_MARK)
352+
346353
private fun isFeatureActive(context: Context, path: String, defaultValue: Boolean = false): Boolean =
347354
context.contentResolver.query(
348355
Uri.withAppendedPath(FeaturesContract.BASE_URI, path),

src/main/java/ru/evotor/framework/features/provider/FeaturesContract.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ object FeaturesContract {
5454
const val PATH_AUTO_FLUIDS_MARK = "auto_fluids_marked"
5555
const val PATH_CHEMICALS_MARK = "chemicals_marked"
5656
const val PATH_VAT22 = "vat22"
57+
const val PATH_FURSLP_MARK = "furslp_marked"
5758

5859
const val COLUMN_IS_ACTIVE = "is_active"
5960
}

src/main/java/ru/evotor/framework/inventory/ProductType.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Тип товара.
5-
* <p>
5+
*
66
* Новые значения добавлять только в конец
77
*/
88
public enum ProductType {
@@ -169,5 +169,10 @@ public enum ProductType {
169169
/**
170170
* Бытовая химия и косметика
171171
*/
172-
CHEMICALS_MARKED
173-
}
172+
CHEMICALS_MARKED,
173+
174+
/**
175+
* Меховые изделия (КМ)
176+
*/
177+
FURSLP_MARKED
178+
}

src/main/java/ru/evotor/framework/receipt/Position.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,19 @@ public Builder toVeterinaryMarked(
17531753
return this;
17541754
}
17551755

1756+
public Builder toFursLpMarked(
1757+
@NonNull Mark mark
1758+
) {
1759+
position.productType = ProductType.FURSLP_MARKED;
1760+
setAlcoParams(
1761+
null,
1762+
null,
1763+
null,
1764+
null
1765+
);
1766+
setFursLpParams(mark);
1767+
return this;
1768+
}
17561769

17571770
public Builder toAutoFluidsMarked(
17581771
@NonNull Mark mark
@@ -1940,6 +1953,8 @@ private void setBeerParams(Mark mark) {
19401953
position.mark = mark;
19411954
}
19421955

1956+
private void setFursLpParams(Mark mark) {position.mark = mark; }
1957+
19431958
public Builder setUuid(String uuid) {
19441959
position.uuid = uuid;
19451960
return this;

0 commit comments

Comments
 (0)