diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml index 643adad9b..acfa29292 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/custom/CustomReportsMapper.xml @@ -8,10 +8,15 @@ left join pmt_transactions t on r.order_id = t.order_id - + + and r.channel = #{channel} + + + + DATE(t.transaction_time) = #{date} + - \ No newline at end of file diff --git a/src/main/ui/index.html b/src/main/ui/index.html index 051c9de6b..b9c3eb001 100644 --- a/src/main/ui/index.html +++ b/src/main/ui/index.html @@ -931,6 +931,12 @@ margin-bottom: 10%;"/> Bill QR Code + +
  • + + Declare Custom + +
  • diff --git a/src/main/ui/static/payment/custom/custom.js b/src/main/ui/static/payment/custom/custom.js new file mode 100644 index 000000000..cde928ad1 --- /dev/null +++ b/src/main/ui/static/payment/custom/custom.js @@ -0,0 +1,107 @@ +define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch'], function (angular) { + 'use strict'; + + var app = angular.module('customManagement', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch']); + app.config(['$stateProvider', function ($stateProvider) { + $stateProvider.state('custom', { + url: '/custom', + templateUrl: '/static/payment/custom/templates/custom.html', + controller: 'customCtrl' + }) + }]); + app.controller('customCtrl', ['$scope', '$http', 'commonDialog','$filter','orderService', function ($scope, $http, commonDialog,$filter,orderService) { + $scope.pagination = {}; + $scope.params = {}; + $scope.new_bill = {}; + $scope.minDate = new Date(); + var maxDate = new Date(); + $scope.maxDate = maxDate.setDate(maxDate.getDate() + 14); + + + $scope.loadBills = function (page) { + var params = angular.copy($scope.params); + params.page = page || $scope.pagination.page || 1; + $http.get('/partner/qrcode', {params: params}).then(function (resp) { + $scope.bills = resp.data; + $scope.pagination = resp.data.pagination; + }); + }; + $scope.loadBills(1); + $scope.generateBill = function () { + var params = angular.copy($scope.new_bill); + if(!params.client_order_id){ + alert("client order id为空,是否后台自动生成?"); + } + if(!params.order_amount){ + alert("order amount不可为空!"); + return; + } + if(params.cancle_time){ + params.cancle_time = $filter('date')(params.cancle_time, 'yyyy-MM-dd HH:mm:ss') + }else { + alert("Expire Date 不可为空!"); + } + $http.post('/partner/qrcode/bills',params).then(function (resp) { + commonDialog.alert({title: 'Success', content: 'Success', type: 'success'}); + $scope.code_url = resp.data; + $scope.loadBills(1); + },function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }); + }; + $scope.disableBill = function (bill) { + commonDialog.confirm( + { + title: 'Delete Bill', + content: 'Are you sure to delete this bill?' + }).then(function () { + $http.delete('/partner/qrcode/'+bill.bill_code_id).then(function(){ + $scope.loadBills(1); + }); + }) + }; + $scope.clearBill = function () { + $scope.new_bill = {}; + $scope.code_url = ""; + }; + + $scope.showTradeDetail = function (order) { + orderService.clientOrderDetail(order) + }; + }]); + + app.filter('billStatus', function () { + return function (status) { + switch (status + '') { + case '1': + return 'wait for payment'; + case '2': + return 'disabled'; + case '3': + return 'payment success' + } + } + }); + + app.filter('remarkCut', function () { + return function (value, wordwise, max, tail) { + if (!value) return ''; + + max = parseInt(max, 10); + if (!max) return value; + if (value.length <= max) return value; + + value = value.substr(0, max); + if (wordwise) { + var lastspace = value.lastIndexOf(' '); + if (lastspace != -1) { + value = value.substr(0, lastspace); + } + } + return value + (tail || ' …'); + }; + }); + + + return app; +}); \ No newline at end of file diff --git a/src/main/ui/static/payment/custom/templates/custom.html b/src/main/ui/static/payment/custom/templates/custom.html new file mode 100644 index 000000000..112dfc9b8 --- /dev/null +++ b/src/main/ui/static/payment/custom/templates/custom.html @@ -0,0 +1,180 @@ + +
    +
    +

    Custom

    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + $ +
    +

    +
    +
    +
    + +
    + +

    The date of expiry should not exceed fifteen days

    +
    +
    + +
    + +
    + +

    System will automatically generate when the Reference NO is empty

    +
    +
    +
    + +
    + +

    within 100 characters

    +
    +
    +
    + +
    +     + +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +   + All | + Success | + Disabled +
    +         +
    + + +
    +
    + +
    +
    +
    + +
    +
    +
    +

    + Bill List +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Order AmountReference NOPayerOrder StatusBill StatusExpire DateRemarkCreate timeOperation
    + + + + + Disable +
    +
    + +
    +
    +
    +
    +
    +
    \ No newline at end of file