Hello Team,
I am trying to sort data in my table from starting date to the end date and any time the date rang is selectd it should display the following on the HTML Page
Product quantity, subTotal, DiscountTotal, VatTotal, and Total below the data table.
HTML PAGE
id="exampleInputUser" aria-describedby="emailHelp"
ng-change="{{TotalAmount}}">
Quantity : {{totalQty}}
Subtotal : Ghc{{subTotal}}
Discount (%) : Ghc{{DiscountTotal}}
VAT (%) : Ghc{{VatTotal}}
Total : Ghc{{Total}}
Vishal JoshiPosted Apr 16, 2023, 5:32 AM
Hello
As per the question you can get the total below the table. you can get it by below code.
Thanks
Vishal
Emmmanuel FIADUFEPosted Apr 16, 2023, 9:26 AM
Thank you so much Vishal for the help, it is working for me now
Emmmanuel FIADUFEPosted Apr 15, 2023, 3:37 PM
AngularJs Controller
(function () {
app.controller('PrintSalesRecord', ['$scope', '$http', '$compile', function ($scope, $http, $compile) {
// declaring a global scope variable
$scope.PrintSalesRecord = new Object();
var init = function () {
//GetProducts();
GetAllPrintSalesRecord();
}; // end of init
init(); //init is called
(function () {
app.controller('PrintSalesRecord', ['$scope', '$http', '$compile', function ($scope, $http, $compile) {
// declaring a global scope variable
$scope.PrintSalesRecord = new Object();
var init = function () {
GetAllPrintSalesRecord();
};
init();
}]);
}).call(angular);
HOME CONTROLLER
[HttpGet]
public ActionResult GetAllPrintSalesRecord()
{
ASPNETMASTERPOSTEntities db = new ASPNETMASTERPOSTEntities();
var dataList = db.tblSales.Join(
db.tblSalesDetails,
sales => sales.SalesId,
detail => detail.SalesId,
(sales, detail) => new { Sales = sales, detail = detail });
var modifiedData = dataList.Select(x => new
{
SalesDetailId = x.detail.SalesDetailId,
Quantity = x.detail.Quantity,
ProductId = x.detail.ProductId,
ProductName = x.detail.tblProduct.ProductName,
SalesId = x.Sales.SalesId,
OrderDate = x.Sales.OrderDate,
SubTotal = x.Sales.SubTotal,
DiscountPercent = x.Sales.DiscountPercent,
VatPercent = x.Sales.VatPercent,
TotalAmount = x.Sales.TotalAmount
}).ToList();
return Json(modifiedData, JsonRequestBehavior.AllowGet);
}