(function(s, u) { s.add({ getPolicyReport: function(filters,success,error) { u.post(this.host + "/api/policy/report", filters, success, error); }, getPolUdwReport: function(filters, success, error) { u.post(this.host + "/api/policy/underwriting", filters, success, error); }, processPolicy: function(data, success, error) { u.post(this.host + "/api/policy/process", data, success, error); }, flagPolicy: function(json, success, error) { u.post(this.host + `/api/policy/flag/${json.flag}/${json.user}`, json.policyIds, success, error); }, searchFlagPolicy: function(filters, success, error) { u.post(this.host + "/api/policy/flag/search", filters, success, error); }, searchOv2Logs: function(filters, success, error) { u.post(this.host + "/api/ov2/report", filters, success, error); }, postOv2: function(policyId, success, error) { u.get(this.host + `/api/ov2/post/${policyId}`, success, error); }, postOv2Renewal: function (policyId, success, error) { u.get(this.host + `/api/ov2/renew/${policyId}`, success, error); } }); })(window.service, window.utility); (function ($, s, u, $scope) { $(function() { $scope.paymentModes = { 0: "CASH", 1: "MOBILE MONEY", 2: "CARD", 3: "HUBTEL" }; $scope.search_grid = u.default_grid("#grdSearchResults", "#grdSearchResultsPager", "Policy Report Results", [ "Product Name", "Risk Name", "Policy Number", "Customer Name", "Customer Email", "Customer Contact No.", "Channel", "Customer Branch", "Intermediary", "Intermediary Email", "Intermediary Contact No.", "Commencement Date", "Expiry Date", "Vehicle Reg No", "Vehicle Make", "Vehicle Model", "Body Type", "Chassis No", "Cubic Capacity", "Vehicle Make year", "Sticker No", "Colour", "Seat Capacity", "TPPD", "Currency", "Currency Rate", "Premium BC", "Premium FC", "Sum Insured BC", "Sum Insured FC", "Delivery(Y/N)", "Pickup Branch", "Delivery Address", "Referral", "Payment Mode", "Receipt Number", "Platform", "Transaction Date", "Transaction ID", "Underwritten By" ], [ { name: "PH_PRD_NAME", index: "PH_PRD_NAME" }, { name: "PH_RSK_NAME", index: "PH_RSK_NAME" }, { name: "PH_POL_NO", index: "PH_POL_NO" }, { name: "PH_CUST_NAME", index: "PH_FULL_NAME" }, { name: "PH_CUST_EMAIL", index: "PH_EMAIL" }, { name: "PH_CUST_PHONE", index: "PH_CONTACT_NO" }, { name: "PH_CHANNL", index: "PH_CHANNL" }, { name: "PH_CUST_BRNCH", index: "PH_CUST_BRNCH" }, { name: "PH_INT_NAME", index: "PH_INT_NAME" }, { name: "PH_INT_EMAIL", index: "PH_INT_EMAIL" }, { name: "PH_INT_PHONE", index: "PH_INT_PHONE" }, { name: "PH_FROM_DATE", index: "PH_FROM_DATE" }, { name: "PH_TO_DATE", index: "PH_TO_DATE" }, { name: "PH_VEH_REG_NO", index: "PH_VEH_REG_NO" }, { name: "PH_VEH_MAKE", index: "PH_VEH_MAKE" }, { name: "PH_VEH_MODEL", index: "PH_VEH_MODEL" }, { name: "PH_VEH_BODY_TYPE", index: "PH_VEH_BODY_TYPE" }, { name: "PH_VEH_CHASSIS_NO", index: "PH_VEH_CHASSIS_NO" }, { name: "PH_CUBIC_CAPACITY", index: "PH_CUBIC_CAPACITY" }, { name: "PH_MAKE_YEAR", index: "PH_MAKE_YEAR" }, { name: "PH_STICKER_NO", index: "PH_STICKER_NO" }, { name: "COLOUR", index: "COLOUR" }, { name: "PH_SEAT_CAPACITY", index: "PH_SEAT_CAPACITY" }, { name: "PH_TPPD_AMT", index: "PH_TPPD_AMT" }, { name: "PH_CUR_CODE", index: "PH_CUR_CODE" }, { name: "PH_CUR_RATE", index: "PH_CUR_RATE" }, { name: "PH_PREM", index: "PH_PREM" }, { name: "PH_PREM_FC", index: "PH_PREM_FC" }, { name: "PH_SI", index: "PH_SI" }, { name: "PH_SI_FC", index: "PH_SI_FC" }, { name: "PH_DELIV_YN", index: "PH_DELIV_YN" }, { name: "PH_DELIV_BRNCH", index: "PH_DELIV_BRNCH" }, { name: "PH_DELIV_ADRS", index: "PH_DELIV_ADRS" }, { name: "PH_REFERAL", index: "PH_REFERAL" }, { name: "PH_PAYMNT_MODE", index: "PH_PAYMNT_MODE" }, { name: "PH_RCPT", index: "PH_RCPT" }, { name: "PH_PLATFORM", index: "PH_PLATFORM" }, { name: "PH_CRTE_DATE", index: "PH_CRTE_DATE" }, { name: "TransactionId", index: "TransactionId" }, { name: "CREATED_BY", index: "CREATED_BY" } ]); //onload fetch a listing of the quotes u.lovDropDown("#PRD_CODE", "getProductLov"); u.lovDropDown("#BRANCH", "get_lov_office"); u.set_datepicker(".date"); $("#fetch").click(function() { if (u.form_validation("#filterForm")) { var filters = u.parse_form("#filterForm"); s.getPolicyReport(filters, function(result) { if (result && result.length && result.length > 0) { u.clear_grid_data($scope.search_grid); result = result.Where(x => x.PH_TXT_STATE === "E"); for (var j in result) { if (result[j].PH_PAYMNT_MODE == 0) { result[j].PH_PAYMNT_MODE = $scope.paymentModes["0"]; }else if (result[j].PH_PAYMNT_MODE == 1) { result[j].PH_PAYMNT_MODE = $scope.paymentModes["1"]; }else if (result[j].PH_PAYMNT_MODE == 2) { result[j].PH_PAYMNT_MODE = $scope.paymentModes["2"]; }else if (result[j].PH_PAYMNT_MODE == 3) { result[j].PH_PAYMNT_MODE = $scope.paymentModes["3"]; } result[j].COLOUR = result[j]["INS_MOTOR_RISK"][0]["MR_COLOR"]; result[j].TransactionId = result[j].INS_PAYMENT_LOG == null ? "" : result[j].INS_PAYMENT_LOG[0].PL_PAYMENT_MODE === "CASH" ? "CASH PAYMENT" : result[j].INS_PAYMENT_LOG[0].PL_TOKEN; $scope.search_grid.addRowData(result[j].ID, result[j]); } } else { u.growl_info("Couldnt find a ny result for the filters selected"); } }); } else { u.growl_warning("The fields marked red are required."); } }); $("#export").click(function() { u.excel_export($scope.search_grid, ["ID"], "Production Report List"); }); $("#reset").click(function () { u.modal_confirmation("Are you sure you want to reset the page?", function (e) { u.hide_confirm(); u.clear_grid_data($scope.search_grid); //u.form_reset("#filterForm"); $("#FROM").val("").text(""); $("#TO").val("").text(""); $("#PRD_CODE").val(""); $("#BRANCH").val(""); u.growl_success("Page reset successfully"); }); }); }); })(window.jQuery, window.service, window.utility, {})