function Report($scope,srv,db,$rootScope) { $scope.Init = async function() { $scope.Firm = "NITROGEN_WEB"; $scope.OrderList = []; $scope.DurumListe = []; DataGrid() $scope.ToplamMiktar = 0 $scope.ToplamFiyat = 0 var today = moment().format('YYYY-MM-DD'); $scope.aa= document.getElementById("FirstDate") $scope.bb = document.getElementById("LastDate") document.getElementById("FirstDate").defaultValue = today; document.getElementById("LastDate").defaultValue = today; $scope.FirstDate = moment(new Date()).format("DD.MM.YYYY"); $scope.LastDate = moment(new Date()).format("DD.MM.YYYY"); var Durum = { db : $scope.Firm, query : "SELECT PACKAGE_STATUS FROM TRANSFER_SERVICE_TRENDYOL GROUP BY PACKAGE_STATUS" } $scope.Dataa = await srv.Execute(Durum) $scope.DurumListe = $scope.Dataa $scope.Durum = "Delivered"; $scope.BtnSearch() } $scope.BtnSearch = async function() { var currentVal = $scope.aa.value; var currentVal2 = $scope.bb.value; let TmpQuery = { db: "NITROGEN_WEB", query : "SELECT * FROM TRANSFER_SERVICE_TRENDYOL WHERE ORDER_DATE >= @Fdate AND ORDER_DATE <= @Ldate AND PACKAGE_STATUS = @PACKAGE ORDER BY ORDER_DATE DESC ", param : ['Fdate','Ldate','PACKAGE'], type : ['date','date','string|50'], value : [currentVal,currentVal2,$scope.Durum] } $scope.Data = await srv.Execute(TmpQuery) if($scope.Data.length > 0) { console.log("aa") $scope.OrderList = $scope.Data; $("#Datagrid").dxDataGrid("instance").option("dataSource", $scope.OrderList); let total = 0 for (let index = 0; index < $scope.OrderList.length; index++) { total = $scope.OrderList[index].TOTAL_PRICE + total } $scope.ToplamFiyat = total; console.log($scope.ToplamFiyat) $scope.ToplamFiyat = ($scope.ToplamFiyat.toFixed(2)) $scope.ToplamMiktar = $scope.OrderList.length } else { swal("Veri Bulunamadı!", "Seçtiğiniz kriterlerde veri bulunamadı.",icon="error"); } $scope.$apply() } function DataGrid() { $("#Datagrid").dxDataGrid ({ dataSource: $scope.UserList, columnMinWidth: 50, columnAutoWidth: true, showBorders: true, filtering: true, sorting: true, summary: true, grouping: true, groupPaging : true, headerFilter: { visible: true }, filterRow: { visible: true, applyFilter: "auto" }, scrolling: { columnRenderingMode: "horizontal" }, columns: [ { caption: 'Sipariş Numarası', dataField: 'ORDER_NUMBER', }, { caption: 'Müşteri Adı', dataField: 'CUSTOMER_TITLE', }, { caption: 'Sipariş Tarihi', dataField: 'ORDER_DATE', dataType: 'date', format: 'dd-MM-yyyy', }, { caption: 'Fiyat', dataField: 'TOTAL_PRICE', }, { caption: 'Durum', dataField: 'PACKAGE_STATUS', }, ], }); $scope.BtnSearch() } // $scope.BtnSearch = function() // { // $scope.GetUser() // } }