text: (window.webpackJsonp=window.webpackJsonp||[]).push([[117],{1357:function(t,s,e){"use strict";e.r(s);var a={created:function(){this.getinvests()},data:function(){return{invest:"",loading:!0,basePath:this.$store.getters.image_base_link,item:"",search:"",investMode:!0,receiveMode:!1,paymentMode:!1,invests:"",invest_profit_paid:"",investment_return:"",total_return:"",investor_id:""}},methods:{i_mode:function(){this.investMode=!0,this.receiveMode=!1,this.paymentMode=!1},r_mode:function(){this.receiveMode=!0,this.paymentMode=!1,this.investMode=!1},p_mode:function(){this.paymentMode=!0,this.investMode=!1,this.receiveMode=!1},getinvests:function(){var t=this;axios.get("/api/company/investor/details/"+this.$route.params.id).then((function(s){console.log(s),t.invests=s.data.invests,t.invest_profit_paid=s.data.invest_profit_paid,t.investment_return=s.data.investment_return,t.total_return=s.data.total_return,t.investor_id=t.$route.params.id,t.loading=!1})).catch((function(t){console.log(t)}))},totalinvestAmount:function(){var t=0;return this.invests.length>0&&this.invests.forEach((function(s){t+=parseInt(s.amount)})),t-parseInt(this.total_return)},totalPaidAmount:function(){var t=0;return this.invest_profit_paid.length>0&&this.invest_profit_paid.forEach((function(s){t+=parseInt(s.amount)})),t},addMore:function(){var t=this,s=prompt("Enter Amount: ");if(parseInt(s)>0){var e=prompt("Enter purpose: ");axios.get("/api/add/more/invest/"+this.$route.params.id,{params:{amount:s,purpose:e}}).then((function(s){console.log(s),"OK"==s.data.success?(alert("invest added successfully"),t.getinvests()):alert("Error Found")})).catch((function(t){console.log(t)}))}}}},n=(e(863),e(1)),i=Object(n.a)(a,(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[e("admin-main"),t._v(" "),e("div",{staticClass:"content-wrapper"},[e("section",{staticClass:"content-header"},[e("h1",[e("a",{staticClass:"btn btn-primary",on:{click:function(s){return s.preventDefault(),t.addMore(s)}}},[e("i",{staticClass:"fa fa-plus"})])]),t._v(" "),t._m(0)]),t._v(" "),e("section",{staticClass:"content"},[e("div",{staticClass:"container"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-lg-1"}),t._v(" "),e("div",{staticClass:"col-lg-3 __c_box"},[e("h4",[t._v("\n              Total Invested Amount:\n\n              "+t._s(t.totalinvestAmount())+"\n            ")])]),t._v(" "),e("div",{staticClass:"col-lg-3 __c_box"},[e("h4",[t._v("\n              Total Profit Paid Amount:\n\n              "+t._s(t.totalPaidAmount())+"\n            ")])])]),t._v(" "),e("div",{staticClass:"row justify-content-center"},[e("div",{staticClass:"col-lg-8 col-lg-offset-1"},[e("div",{staticClass:"box box-primary"},[e("div",{staticClass:"box-header with-border"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-3"},[e("h3",{staticClass:"box-title",class:{bb:t.investMode},on:{click:t.i_mode}},[t._v("\n                      Invest History\n                    ")]),t._v(" "),e("a",{staticClass:"btn btn-success",attrs:{href:"/api/invest/history/download/pdf/"+t.investor_id,target:"_blank"}},[e("i",{staticClass:"fa fa-download"})])]),t._v(" "),e("div",{staticClass:"col-md-4"},[e("h3",{staticClass:"box-title",on:{click:t.r_mode}},[t._v("\n                      Profit Paid History\n                    ")]),t._v(" "),e("a",{staticClass:"btn btn-success",attrs:{href:"/api/investor/paid/history/download/pdf/"+t.investor_id,target:"_blank"}},[e("i",{staticClass:"fa fa-download"})])]),t._v(" "),e("div",{staticClass:"col-md-4"},[e("h3",{staticClass:"box-title",on:{click:t.p_mode}},[t._v(" Return History\n                    ")])])])]),t._v(" "),e("div",{staticClass:"box-body"},[t.investMode?e("table",{staticClass:"table"},[t._m(1),t._v(" "),e("tbody",[t.loading?e("h1",{staticClass:"text-center"},[e("i",{staticClass:"fa fa-spin fa-spinner"})]):t._e(),t._v(" "),t._l(t.invests,(function(s,a){return e("tr",{key:a},[e("td",{attrs:{scope:"row"}},[t._v(t._s(a+1))]),t._v(" "),e("td",[t._v(t._s(s.date))]),t._v(" "),e("td",[t._v(t._s(s.purpose))]),t._v(" "),e("td",[t._v(t._s(s.amount))])])})),t._v(" "),e("tr",[e("td",{attrs:{colspan:"3"}}),t._v(" "),e("td",[e("strong",[t._v(" ="+t._s(t.totalinvestAmount()))])])])],2)]):t._e(),t._v(" "),t.receiveMode?e("table",{staticClass:"table text-center table-striped "},[t._m(2),t._v(" "),e("tbody",[t.loading?e("h1",{staticClass:"text-center"},[e("i",{staticClass:"fa fa-spin fa-spinner"})]):t._e(),t._v(" "),t._l(t.invest_profit_paid,(function(s,a){return e("tr",{key:a},[e("td",{attrs:{scope:"row"}},[t._v(t._s(a+1))]),t._v(" "),e("td",[t._v(t._s(s.date))]),t._v(" "),e("td",[t._v(t._s(s.profit_month))]),t._v(" "),e("td",[t._v(t._s(s.comment))]),t._v(" "),e("td",[t._v(t._s(s.paid_by))]),t._v(" "),e("td",[t._v(t._s(s.amount))])])})),t._v(" "),e("tr",[e("td",{attrs:{colspan:"5"}},[t._v(" Total profit paid ")]),t._v(" "),e("td",[e("strong",[t._v(" ="+t._s(t.totalPaidAmount()))])])])],2)]):t._e(),t._v(" "),t.paymentMode?e("table",{staticClass:"table text-center table-striped "},[t._m(3),t._v(" "),e("tbody",[t.loading?e("h1",{staticClass:"text-center"},[e("i",{staticClass:"fa fa-spin fa-spinner"})]):t._e(),t._v(" "),t._l(t.investment_return,(function(s,a){return e("tr",{key:a},[e("td",{attrs:{scope:"row"}},[t._v(t._s(a+1))]),t._v(" "),e("td",[t._v(t._s(s.date))]),t._v(" "),e("td",[t._v(t._s(s.comment))]),t._v(" "),e("td",[t._v(t._s(s.paid_by))]),t._v(" "),e("td",[t._v(t._s(s.amount))])])})),t._v(" "),e("tr",[e("td",{attrs:{colspan:"4"}},[t._v(" Total Return Amount ")]),t._v(" "),e("td",[e("strong",[t._v(" ="+t._s(t.total_return))])])])],2)]):t._e()])])])])])])])],1)}),[function(){var t=this.$createElement,s=this._self._c||t;return s("ol",{staticClass:"breadcrumb"},[s("li",[s("a",{attrs:{href:"#"}},[s("i",{staticClass:"fa fa-dashboard"}),this._v("Dashboard")])]),this._v(" "),s("li",{staticClass:"active"},[this._v("Investor")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("thead",[s("tr",[s("th",{attrs:{scope:"col"}},[this._v("#")]),this._v(" "),s("th",{attrs:{scope:"col"}},[this._v("Date")]),this._v(" "),s("th",{attrs:{scope:"col"}},[this._v("Purpose")]),this._v(" "),s("th",{attrs:{scope:"col"}},[this._v("Amount")])])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("thead",[e("tr",[e("th",{attrs:{scope:"col"}},[t._v("#")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Date")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Profit Month  ")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Comment")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Paid By")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Amount")])])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("thead",[e("tr",[e("th",{attrs:{scope:"col"}},[t._v("#")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Date")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Comment")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Paid By")]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v("Amount")])])])}],!1,null,null,null);s.default=i.exports},260:function(t,s,e){var a=e(864);"string"==typeof a&&(a=[[t.i,a,""]]);var n={hmr:!0,transform:void 0,insertInto:void 0};e(5)(a,n);a.locals&&(t.exports=a.locals)},863:function(t,s,e){"use strict";var a=e(260);e.n(a).a},864:function(t,s,e){(t.exports=e(4)(!1)).push([t.i,"\n.col-lg-3.__c_box {\r\n  padding: 10px;\r\n  background: #fff;\r\n  width: 250px;\r\n  height: 85px;\r\n  margin-right: 15px;\r\n  margin-bottom: 20px;\r\n  text-align: center;\r\n  box-shadow: 3px 3px 3px #ddd;\n}\n.box-title {\r\n  padding: 5px 6px;\r\n  cursor: pointer;\n}\n.bb {\r\n  border-bottom: 2px solid #000;\n}\r\n",""])}}]);