Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1052. Highlighting the names of products when they are low in quantity. #1084

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public void Build(ModelBuilder modelBuilder)

modelBuilder.Entity<AppSetting>().HasData(
new AppSetting("Catalog.ProductPageSize") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "10" },
new AppSetting("Catalog.IsProductPriceIncludeTax") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "true" }
new AppSetting("Catalog.IsProductPriceIncludeTax") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "true" },
new AppSetting("Catalog.MinimumProductQuantityForHighlighting") { Module = "Catalog", IsVisibleInCommonSettingPage = true, Value = "5" }
);

modelBuilder.Entity<EntityType>().HasData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ <h2>{{::vm.translate.get('Stock management for warehouse')}} <strong>{{ vm.selec
</tr>
</thead>
<tbody ng-show="!vm.isLoading">
<tr ng-repeat="item in vm.stocks">
<tr ng-repeat="item in vm.stocks"
style="{{item.quantity < vm.minimumQuantityForHighlighting ? 'background-color: #ffff8f;' : ''}}"
>
<td>{{item.productName}}</td>
<td>{{item.productSku}}</td>
<td class="text-right">{{item.quantity}}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
(function () {
angular
.module('simplAdmin.inventory')
.controller('StockFormCtrl', ['stockService', 'translateService', StockFormCtrl]);
.controller('StockFormCtrl', ['configurationService','stockService', 'translateService', StockFormCtrl]);

function StockFormCtrl(stockService, translateService) {
function StockFormCtrl(configurationService, stockService, translateService) {
var vm = this;
vm.tableStateRef = {};
vm.translate = translateService;
Expand Down Expand Up @@ -42,5 +42,11 @@
vm.selectedWarehouse = vm.warehouses[0];
}
});

configurationService.getSettings().then(function (result) {
const minimumQuantityForHighlighting = result.data.find(o => o.key === "Catalog.MinimumProductQuantityForHighlighting");

vm.minimumQuantityForHighlighting = minimumQuantityForHighlighting ? minimumQuantityForHighlighting.value : 0;
});
}
})();