/// <reference path="MenuSliding.js" />
function ClearSalesReportController($scope, $http) {
$(document).ready(function () {
$('.DtPickr').Zebra_DatePicker({
format: 'd,M, Y',
});
});
var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
$scope.ViewData = {
UserID: null,
UserName: '',
ErrorMsg: '',
SessionId: '',
PageNo: '',
BrnchID: null,
SelectedDate: '',
Navgation: '',
SletdSalsAltrId: '',
BrnchColectn: { BrnchID: '', BrnchName: '' },
UsrDtls: {
UserID: '', UserName: ''
},
ClrSalDtls: {
SalsAltrId: '', Date: '', BillNo: '', Amount: '', User: '', Brnch: { BrnchName: '' },
ClrBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } },
AcBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } }
},
};
$scope.PageNoObj = [{ Pno: '' }]
$scope.SelectedData = {
UserID: null,
UserName: '',
ErrorMsg: '',
SessionId: '',
PageNo: '',
BrnchID: null,
SletdSalsAltrId: '',
SelectedDate: '',
Navgation: '',
BrnchColectn: { BrnchID: '', BrnchName: '' },
UsrDtls: {
UserID: '', UserName: ''
},
ClrSalDtls: {
SalsAltrId: '', Date: '', BillNo: '', Amount: '', User: '', Brnch: { BrnchName: '' },
ClrBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } },
AcBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } }
},
};
$scope.ViewData.SessionId = url[0].split('=')[1];
if ($scope.ViewData.SessionId != null && $scope.ViewData.SessionId != '') {
$http({ method: 'POST', url: 'ClearSalesReport.ashx', params: { OnLoad: JSON.stringify($scope.ViewData) } }).success(function (RetData) {
if (RetData != undefined && RetData != null && RetData != '') {
if (RetData.ErrorMsg != null && RetData.ErrorMsg != "") {
if (RetData.ErrorMsg == "-100")
window.location = "login.html";
else {
alert(RetData.ErrorMsg);
}
}
else {
$scope.ViewData = RetData;
$scope.SelectedData.BrnchColectn.BrnchID = RetData.BrnchID;
$scope.SelectedData.SelectedDate = RetData.SelectedDate;
$scope.SelectedData.SessionId = RetData.SessionId;
$scope.PageNoObj.Pno = new Object();
for (var i = 1; i <= $scope.ViewData.PageNo; i++) {
$scope.PageNoObj.Pno[i] = i;
} AddMenuList(RetData.Menus);
}
}
else {
alert('Network Unreachable');
}
});
var SalMastr = null;
$scope.LoadBillDetails = function (SalMastr) {
$scope.SelectedData.BrnchID = $scope.SelectedData.BrnchColectn.BrnchID;
$scope.SelectedData.SletdSalsAltrId = SalMastr;
$http({ method: 'POST', url: 'ClearSalesReport.ashx', params: { GetSubData: JSON.stringify($scope.SelectedData) } }).success(function (RetData) {
if (RetData != undefined && RetData != null && RetData != '') {
if (RetData.ErrorMsg != null && RetData.ErrorMsg != "") {
if (RetData.ErrorMsg == "-100")
window.location = "login.html";
else {
alert(RetData.ErrorMsg);
}
}
else {
$scope.ViewData.AcBillDetls = RetData.AcBillDetls;
$scope.ViewData.ClrBillDetls = RetData.ClrBillDetls;
}
}
else {
alert('Network Unreachable');
}
});
}
$scope.DoLoadList = function (args, PageNo) {
$scope.ViewData.ErrorMsg = null;
$scope.SelectedData.Navgation = args;
$scope.SelectedData.BrnchID = $scope.SelectedData.BrnchColectn.BrnchID;
$scope.SelectedData.UserID = $scope.SelectedData.UsrDtls.UserID;
$scope.SelectedData.PageNo = PageNo;
$scope.SelectedData.SelectedDate = $('.DtPickr').val();
$http({ method: 'POST', url: 'ClearSalesReport.ashx', params: { GetData: JSON.stringify($scope.SelectedData) } }).success(function (RetData) {
if (RetData !== undefined && RetData !== null && RetData != '') {
if (RetData.ErrorMsg != null && RetData.ErrorMsg != "") {
if (RetData.ErrorMsg == "-100")
window.location = "login.html";
else {
alert(RetData.ErrorMsg);
}
}
else {
if (args == "LU")
$scope.ViewData.UsrDtls = RetData.UsrDtls;
$scope.ViewData.ClrSalDtls = RetData.ClrSalDtls;
$scope.SelectedData.SelectedDate = RetData.SelectedDate;
$scope.PageNoObj.Pno = new Object();
for (var i = 1; i <= RetData.PageNo; i++) {
$scope.PageNoObj.Pno[i] = i;
}
}
}
else {
alert('Network Unreachable');
}
});
}
}
else {
window.location = "login.html";
}
}
function ClearSalesReportController($scope, $http) {
$(document).ready(function () {
$('.DtPickr').Zebra_DatePicker({
format: 'd,M, Y',
});
});
var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
$scope.ViewData = {
UserID: null,
UserName: '',
ErrorMsg: '',
SessionId: '',
PageNo: '',
BrnchID: null,
SelectedDate: '',
Navgation: '',
SletdSalsAltrId: '',
BrnchColectn: { BrnchID: '', BrnchName: '' },
UsrDtls: {
UserID: '', UserName: ''
},
ClrSalDtls: {
SalsAltrId: '', Date: '', BillNo: '', Amount: '', User: '', Brnch: { BrnchName: '' },
ClrBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } },
AcBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } }
},
};
$scope.PageNoObj = [{ Pno: '' }]
$scope.SelectedData = {
UserID: null,
UserName: '',
ErrorMsg: '',
SessionId: '',
PageNo: '',
BrnchID: null,
SletdSalsAltrId: '',
SelectedDate: '',
Navgation: '',
BrnchColectn: { BrnchID: '', BrnchName: '' },
UsrDtls: {
UserID: '', UserName: ''
},
ClrSalDtls: {
SalsAltrId: '', Date: '', BillNo: '', Amount: '', User: '', Brnch: { BrnchName: '' },
ClrBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } },
AcBillDetls: { Rate: '', Qty: '', TtlAmt: '', Tax: '', ItmDtls: { ItemName: '', ItemCode: '' } }
},
};
$scope.ViewData.SessionId = url[0].split('=')[1];
if ($scope.ViewData.SessionId != null && $scope.ViewData.SessionId != '') {
$http({ method: 'POST', url: 'ClearSalesReport.ashx', params: { OnLoad: JSON.stringify($scope.ViewData) } }).success(function (RetData) {
if (RetData != undefined && RetData != null && RetData != '') {
if (RetData.ErrorMsg != null && RetData.ErrorMsg != "") {
if (RetData.ErrorMsg == "-100")
window.location = "login.html";
else {
alert(RetData.ErrorMsg);
}
}
else {
$scope.ViewData = RetData;
$scope.SelectedData.BrnchColectn.BrnchID = RetData.BrnchID;
$scope.SelectedData.SelectedDate = RetData.SelectedDate;
$scope.SelectedData.SessionId = RetData.SessionId;
$scope.PageNoObj.Pno = new Object();
for (var i = 1; i <= $scope.ViewData.PageNo; i++) {
$scope.PageNoObj.Pno[i] = i;
} AddMenuList(RetData.Menus);
}
}
else {
alert('Network Unreachable');
}
});
var SalMastr = null;
$scope.LoadBillDetails = function (SalMastr) {
$scope.SelectedData.BrnchID = $scope.SelectedData.BrnchColectn.BrnchID;
$scope.SelectedData.SletdSalsAltrId = SalMastr;
$http({ method: 'POST', url: 'ClearSalesReport.ashx', params: { GetSubData: JSON.stringify($scope.SelectedData) } }).success(function (RetData) {
if (RetData != undefined && RetData != null && RetData != '') {
if (RetData.ErrorMsg != null && RetData.ErrorMsg != "") {
if (RetData.ErrorMsg == "-100")
window.location = "login.html";
else {
alert(RetData.ErrorMsg);
}
}
else {
$scope.ViewData.AcBillDetls = RetData.AcBillDetls;
$scope.ViewData.ClrBillDetls = RetData.ClrBillDetls;
}
}
else {
alert('Network Unreachable');
}
});
}
$scope.DoLoadList = function (args, PageNo) {
$scope.ViewData.ErrorMsg = null;
$scope.SelectedData.Navgation = args;
$scope.SelectedData.BrnchID = $scope.SelectedData.BrnchColectn.BrnchID;
$scope.SelectedData.UserID = $scope.SelectedData.UsrDtls.UserID;
$scope.SelectedData.PageNo = PageNo;
$scope.SelectedData.SelectedDate = $('.DtPickr').val();
$http({ method: 'POST', url: 'ClearSalesReport.ashx', params: { GetData: JSON.stringify($scope.SelectedData) } }).success(function (RetData) {
if (RetData !== undefined && RetData !== null && RetData != '') {
if (RetData.ErrorMsg != null && RetData.ErrorMsg != "") {
if (RetData.ErrorMsg == "-100")
window.location = "login.html";
else {
alert(RetData.ErrorMsg);
}
}
else {
if (args == "LU")
$scope.ViewData.UsrDtls = RetData.UsrDtls;
$scope.ViewData.ClrSalDtls = RetData.ClrSalDtls;
$scope.SelectedData.SelectedDate = RetData.SelectedDate;
$scope.PageNoObj.Pno = new Object();
for (var i = 1; i <= RetData.PageNo; i++) {
$scope.PageNoObj.Pno[i] = i;
}
}
}
else {
alert('Network Unreachable');
}
});
}
}
else {
window.location = "login.html";
}
}
No comments:
Post a Comment