function GetAllPrintSalesRecord() {
const urlParams = new URLSearchParams(window.location.search);
const OrderNo = urlParams.get('OrderNo');
.then(function (response) {
var data = response.data.modifiedData;
$scope.PrintSalesRecordList = data;
$scope.OrderDate = response.data.OrderDate;
$scope.Total = response.data.total;
$scope.DiscountTotal = response.data.discount;
$scope.VatTotal = response.data.tax;
if ($scope.$$phase) {
$scope.$apply();
}
Loading
Vishal JoshiPosted Feb 9, 2024, 5:38 AM
Hello,
You need to check bindings. as per the code you have bind the data in data variable and still in OrderDate trying to bind data from response model.
Try the below code to get the Date:
Thanks
Vishal Joshi
Emmmanuel FIADUFEPosted Feb 10, 2024, 4:13 PM
Thank you team, please it is working now
Amit MohantyPosted Feb 9, 2024, 6:05 AM
Check the values of response.data.OrderDate and other variables to ensure they contain the expected values by using console.log.
You can directly apply changes to the scope using $scope.$apply() without conditionally checking $scope.$$phase.
You might need to format response.data.OrderDate by using AngularJS filters or JavaScript Date functions, if it is not in correct format.
Jayraj ChhayaPosted Feb 9, 2024, 5:39 AM
you can follow these steps:
Check the response from the server: Make sure that the server is sending the correct data for the
OrderDatefield. You can use browser developer tools or console.log to inspect the response and verify that theOrderDatevalue is present and in the expected format.Verify the data binding: Ensure that the
$scope.OrderDatevariable is correctly bound to the date value in the HTML template. Double-check the variable name and make sure it matches the one used in the template.Check for any errors or exceptions: Look for any error messages or exceptions in the browser console that might be preventing the date from being displayed. Address any errors or exceptions that you find.
Verify the HTML template: Check the HTML template where the receipt header is defined. Make sure that the
OrderDatevariable is correctly referenced in the template using AngularJS's data binding syntax, such as{{ OrderDate }}.Test with sample data: If the above steps do not resolve the issue, try hardcoding a sample date value directly in the controller and see if it appears in the receipt header. This will help determine if the issue is with the data or the code logic.