File "cipFinancialReports.749de1eac0662f2a10ec.js"
Full path: /home/satitravel/public_html/wp-content/plugins/citynet/public/mobile/js/cipFinancialReports.749de1eac0662f2a10ec.js
File
size: 18 B
MIME-type: text/plain
Charset: utf-8
Download Open Edit Advanced Editor &nnbsp; Back
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["cipFinancialReports"],{"17fe":function(t,e,a){},"6b23":function(t,e,a){"use strict";a("17fe")},bfbe:function(t,e,a){"use strict";a.r(e);var s=a("0798"),n=a("c6a6"),i=a("8336"),r=a("b0af"),o=a("99d9"),l=a("cc20"),c=a("62ad"),p=a("8fea"),d=a("8860"),u=a("da13"),f=a("5d23"),m=a("490a"),y=a("0fd9"),h=a("b974"),b=a("1f4f"),_=a("8654"),g=function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"mt-12 px-4"},[e(r["a"],{staticClass:"py-4 mb-3 moreRadius button",attrs:{flat:"",tile:""}},[e(o["d"],{staticClass:"black--text"},[t._v(" "+t._s(t.$t("cipFinancialReports")))]),e(y["a"],{staticClass:"px-5"},[e(c["a"],{attrs:{cols:"12",md:"3"}},[e("date-picker",{ref:"Datepicker",attrs:{locale:t.locale,label:t.$t("fromDate"),startLabel:t.$t("fromDate"),endLabel:t.$t("toDate"),dense:"",clearable:"",height:44,"locale-config":{fa:{inputFormat:"jdddd jYYYY/jMM/jDD "},en:{inputFormat:"dddd YYYY/MM/DD "}},selectSource:t.selectSource,to:t.todayJ,disable:t.disabledDates,"auto-submit":!0},on:{focus:function(e){t.selectSource=1},changeLocales:t.getDatePickerLocale,rangeBegin:t.rangeBegin},model:{value:t.startDate,callback:function(e){t.startDate=e},expression:"startDate"}})],1),e(c["a"],{staticClass:"pb-0",attrs:{cols:"12",md:"3"}},[e(_["a"],{staticClass:"moreRadius input font-size-13 font-weight-300",attrs:{label:t.$t("toDate"),readonly:"",outlined:"","clear-icon":"icon-remove icon-18 grey--text",dense:"",clearable:"",height:44},on:{click:function(e){t.$refs.Datepicker.showPicker("input"),t.selectSource=2}},scopedSlots:t._u([{key:"prepend-inner",fn:function(){return[e("i",{staticClass:"homepage-icon-color pl-1 icon-calendar",staticStyle:{"pointer-events":"none"}})]},proxy:!0}]),model:{value:t.displayEndDate,callback:function(e){t.displayEndDate=e},expression:"displayEndDate"}})],1),e(c["a"],{attrs:{cols:"12",md:"3"}},[e(n["a"],{staticClass:"caption moreRadius input buyers",staticStyle:{"font-size":"13px"},attrs:{items:t.buyers,"cache-items":!1,"no-filter":"",outlined:"",attach:".buyers","hide-details":"auto",dense:"","menu-props":{"offset-y":!0,closeOnClick:!0},clearable:"","clear-icon":"icon-remove icon-18","append-icon":"","search-input":t.buyerInput,"hide-no-data":"","return-object":"",label:t.$t("buyer"),height:44},on:{"update:searchInput":function(e){t.buyerInput=e},"update:search-input":function(e){t.buyerInput=e}},scopedSlots:t._u([{key:"item",fn:function(a){return[e(d["a"],{staticClass:"pa-0",attrs:{width:"100%"}},[e(u["a"],{staticClass:"pa-0"},[e(f["a"],{staticClass:"py-0",staticStyle:{direction:"ltr","text-align":"initial"}},[e(f["c"],{staticClass:"caption mb-0"},[t._v(" "+t._s(a.item.Name)+" "+t._s(a.item.Family)+" "),e(l["a"],{attrs:{small:""}},[t._v(" "+t._s(a.item.Mobile)+" ")])],1)],1)],1)],1)]}},{key:"selection",fn:function(a){return[e(d["a"],{staticClass:"pa-0",attrs:{width:"100%"}},[e(u["a"],{staticClass:"pa-0"},[e(f["a"],{staticClass:"py-0",staticStyle:{direction:"ltr","text-align":"initial"}},[e(f["c"],{staticClass:"caption mb-0"},[t._v(" "+t._s(a.item.Name)+" "+t._s(a.item.Family)+" "),e(l["a"],{attrs:{small:""}},[t._v(" "+t._s(a.item.Mobile)+" ")])],1)],1)],1)],1)]}}]),model:{value:t.buyer,callback:function(e){t.buyer=e},expression:"buyer"}})],1),e(c["a"],{attrs:{cols:"12",md:"3"}},[e(h["a"],{staticClass:"caption moreRadius input reportType",attrs:{outlined:"",label:t.$t("reportType"),items:t.reportType,"item-text":"name","hide-details":"auto","menu-props":{"offset-y":!0,closeOnClick:!0},"append-icon":"icon-chevron-down icon-18",dense:"",attach:".reportType","item-value":"value",height:44},model:{value:t.reportTypeId,callback:function(e){t.reportTypeId=e},expression:"reportTypeId"}})],1),e(c["a"],{attrs:{cols:"12",md:"3"}},[e(_["a"],{staticClass:"moreRadius input",staticStyle:{"font-size":"13px"},attrs:{label:t.$t("subsystemId"),"hide-details":"",type:"number",outlined:"",height:44,dense:"",clearable:""},model:{value:t.subsystemId,callback:function(e){t.subsystemId=e},expression:"subsystemId"}})],1),e(c["a"],{attrs:{cols:"12",md:"3"}},[e(h["a"],{staticClass:"caption moreRadius input flightType",attrs:{outlined:"",label:t.$t("flightType"),items:t.flightType,"item-text":"name","hide-details":"auto","menu-props":{"offset-y":!0,closeOnClick:!0},"append-icon":"icon-chevron-down icon-18",dense:"",attach:".flightType","item-value":"value",height:44},model:{value:t.flightTypeId,callback:function(e){t.flightTypeId=e},expression:"flightTypeId"}})],1),e(c["a"],{attrs:{cols:"12",md:"3"}},[e(h["a"],{staticClass:"caption moreRadius input typePassenger",attrs:{outlined:"",label:t.$t("typePassenger"),items:t.typePassenger,"item-text":"name","hide-details":"auto","menu-props":{"offset-y":!0,closeOnClick:!0},"append-icon":"icon-chevron-down icon-18",dense:"",attach:".typePassenger","item-value":"value",height:44},model:{value:t.typePassengerId,callback:function(e){t.typePassengerId=e},expression:"typePassengerId"}})],1),e(c["a"],{staticClass:"d-flex justify-end",attrs:{cols:"12",md:"3"}},[e(i["a"],{staticClass:"py-2 px-7 moreRadius button",attrs:{color:"buttons",dark:"",width:"135","x-large":"",height:"42",depressed:"",loading:t.dataLoading},on:{click:t.getData}},[t._v(" "+t._s(t.$t("search"))+" ")]),e(i["a"],{staticClass:"py-2 px-4 theme-element-bg-light moreRadius button",class:t.$vuetify.rtl?"mr-2":"ml-2",attrs:{disabled:!t.startDate.length,depressed:"",height:"42",width:"100",loading:t.dataLoadingExcel},on:{click:t.getExcel}},[e("span",{staticClass:"text-center font-weight-regular"},[t._v("Excel")])])],1)],1)],1),t.dataLoading?e(m["a"],{staticClass:"mx-auto d-block mt-5",attrs:{indeterminate:"",size:"44"}}):t._e(),!t.dataLoading&&t.financialReports.length>0?e(p["a"],{staticClass:"ruleTable",staticStyle:{"border-radius":"20px"},attrs:{headers:t.headers,items:t.financialReports,"item-key":"id",options:{page:1,itemsPerPage:20},flat:"","footer-props":{"items-per-page-text":""}},scopedSlots:t._u([{key:"item.row",fn:function({index:e}){return[t._v(" "+t._s(t._f("simplePersian")(e+1,t.$i18n.locale))+" ")]}},{key:"item.ContractNo",fn:function({item:e}){return[t._v(" "+t._s(e.ContractNo)+" ")]}},{key:"item.Bed",fn:function({item:e}){return[t._v(" "+t._s(t._f("price")(e.Bed))+" ")]}},{key:"item.Bes",fn:function({item:e}){return[t._v(" "+t._s(t._f("price")(e.Bes))+" ")]}},{key:"item.Comment",fn:function({item:e}){return[t._v(" "+t._s(e.Comment?e.Comment:"--")+" ")]}},{key:"item.Currency",fn:function({item:e}){return[t._v(" "+t._s(t._f("currency")(e.Currency))+" ")]}},{key:"item.Owner",fn:function({item:a}){return[e("span",{staticClass:"d-block white-space-nowrap"},[t._v(t._s(""+a.Owner))]),e("span",{staticClass:"d-block white-space-nowrap"},[t._v(t._s(""+a.Username))]),e("span",{staticClass:"d-block white-space-nowrap"},[t._v(t._s(""+(a.CompanyName?a.CompanyName:"--")))])]}},{key:"item.GivenName",fn:function({item:e}){return[t._v(" "+t._s(`${e.GivenName} ${e.SurName}`)+" ")]}},{key:"item.createdAt",fn:function({item:a}){return[e("span",{staticClass:"d-block mx-2 pt-2 white-space-nowrap"},[t._v(t._s(""+a.createdAt.split(" ")[0]))]),"fa"==t.$i18n.locale?e("span",{staticClass:"d-block mx-2 py-1 white-space-nowrap"},[t._v(t._s(t._f("persianDateTime")(""+a.createdAt.split(" ")[0],"/")))]):t._e(),e("span",{staticClass:"pb-2"},[t._v(" "+t._s(t._f("simplePersian")(""+a.createdAt.split(" ")[1],t.$i18n.locale))+" ")])]}},{key:"item.serviceDate",fn:function({item:a}){return[a.serviceDate?e("span",[t._v(" "+t._s(t._f("persianDateTime")(""+a.serviceDate,"/")))]):e("span",[t._v(" --")])]}},{key:"item.serviceInfo",fn:function({item:e}){return[t._v(" "+t._s(e.serviceInfo?e.serviceInfo:"--")+" ")]}},{key:"item.AccountType",fn:function({item:e}){return[t._v(" "+t._s("CIP"==e.AccountType?t.$t("economy"):"BC"==e.AccountType?t.$t("business"):"--")+" ")]}},{key:"item.flightType",fn:function({item:a}){return[e("span",{staticClass:"d-block white-space-nowrap"},[t._v(" "+t._s(t.$t(a.flightType))+" ")]),e("span",{staticClass:"d-block white-space-nowrap"},[t._v(" "+t._s(""+a.SubsystemName)+" ("+t._s(""+a.SubsystemId)+") ")])]}}],null,!0)}):t._e(),!t.dataLoading&&t.financialReports.length>0?e(b["a"],{staticClass:"mt-3",staticStyle:{"border-radius":"20px"},scopedSlots:t._u([{key:"default",fn:function(){return[e("thead",[e("tr",[e("th",[t._v(t._s(t.$t("baseRate")))]),e("th",[t._v(t._s(t.$t("tax")))]),e("th",[t._v(t._s(t.$t("commission")))]),e("th",[t._v(t._s(t.$t("extraCost")))]),e("th",[t._v(t._s(t.$t("ExtraCommission")))]),e("th",[t._v(t._s(t.$t("penalty")))]),e("th",[t._v(t._s(t.$t("extraPenalty")))])])]),e("tbody",[e("tr",[e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumField("Bed","نرخ پایه"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumField("Bed","مالیات"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumField("Bed","کمیسیون"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumField("Bed","هزینه مازاد"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumField("Bed","کمیسیون مازاد"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumField("Bed","جریمه"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumField("Bed","جریمه مازاد"))))])])]),e("tr",[e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumField("Bes","نرخ پایه"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumField("Bes","مالیات"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumField("Bes","کمیسیون"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumField("Bes","هزینه مازاد"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumField("Bes","کمیسیون مازاد"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumField("Bes","جریمه"))))])]),e("td",[e("span",{staticClass:"d-block"},[t._v(t._s(t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumField("Bes","جریمه مازاد"))))])])]),e("tr",[e("td",{attrs:{colspan:"6"}}),e("td",[e("span",{staticClass:"d-block white-space-nowrap pt-4 pb-3"},[t._v(t._s(t.$t("totalSum")+" "+t.$t("Debtor"))+" : "+t._s(t._f("price")(t.sumFieldBed("Bed"))))]),e("span",{staticClass:"d-block white-space-nowrap pb-4"},[t._v(t._s(t.$t("totalSum")+" "+t.$t("Creditor"))+" : "+t._s(t._f("price")(t.sumFieldBed("Bes"))))])])])])]},proxy:!0}],null,!1,3081844632)}):t._e(),t.dataLoading||0!=t.financialReports.length?t._e():e(s["a"],{staticClass:"body-1 my-4 mx-auto text-center",attrs:{text:"",border:"left",color:"#FF791F"}},[e("span",[t._v(t._s(t.$t("noDataFound")))])])],1)},v=[],C=a("60a3"),$=a("5c1f"),D=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),x=function(t,e,a,s){var n,i=arguments.length,r=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,a):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,a,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(r=(i<3?n(r):i>3?n(e,a,r):n(e,a))||r);return i>3&&r&&Object.defineProperty(e,a,r),r},k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.financialReports=[],e.startDate="",e.selectSource=1,e.dpLocale="fa",e.dataLoading=!1,e.dataLoadingExcel=!1,e.itemsPerPage=10,e.page=1,e.pageCount=0,e.buyers=[],e.buyerInput="",e.buyer={Id:-1},e.subsystemId=null,e.searchAirlines="",e.airlineIata=null,e.airlines=[],e.flightType=[],e.flightTypeId=null,e.typePassenger=[],e.typePassengerId=null,e.dateType=[],e.dateTypeId={name:e.$t("localDate"),value:"local"},e.reportType=[],e.reportTypeId=null,e.headers=[{text:"#",value:"row",align:"center",sortable:!1},{text:e.$t("contractNo"),value:"ContractNo",align:"center"},{text:e.$t("buyerName"),value:"Owner",sortable:!1,align:"center"},{text:e.$t("createdAt"),value:"createdAt",align:"center"},{text:e.$t("travelDate"),value:"serviceDate",align:"center",sortable:!1},{text:e.$t("fullName"),value:"GivenName",sortable:!1,align:"center"},{text:e.$t("reference"),value:"serviceInfo",align:"center",sortable:!1},{text:e.$t("flightType"),value:"flightType",align:"center",sortable:!1},{text:e.$t("typePassenger"),value:"AccountType",align:"center",sortable:!1},{text:e.$t("type"),value:"Type",sortable:!1,align:"center"},{text:e.$t("description"),value:"Comment",sortable:!1,align:"center"},{text:e.$t("currencyType"),value:"Currency",sortable:!1,align:"center"},{text:e.$t("Debtor"),value:"Bed",align:"center",sortable:!1},{text:e.$t("Creditor"),value:"Bes",align:"center",sortable:!1}],e}return D(e,t),e.prototype.created=function(){this.startDate=[this.todayG,this.todayG],this.getData()},e.prototype.mounted=function(){this.initializeHeaders()},e.prototype.initializeHeaders=function(){this.flightType=[{name:this.$t("inbound"),value:"inbound"},{name:this.$t("outbound"),value:"outbound"}],this.typePassenger=[{name:this.$t("all"),value:"all"},{name:this.$t("economy"),value:"CIP"},{name:this.$t("business"),value:"BC"}],this.dateType=[{name:this.$t("localDate"),value:"local"},{name:this.$t("utcDate"),value:"UTC"}],this.reportType=[{name:this.$t("all"),value:"all"},{name:this.$t("saleReport"),value:"sale"},{name:this.$t("cancelReport"),value:"cancel"}]},Object.defineProperty(e.prototype,"todayG",{get:function(){return(new this.$persianDate).calendar("g").toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todayJ",{get:function(){return(new this.$persianDate).calendar("j").toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){return"fa"==this.$i18n.locale?"fa,en":"en,fa"},enumerable:!1,configurable:!0}),e.prototype.disabledDates=function(t){return console.log(t.calendar("g").isAfter(new this.$persianDate(this.startDate[0]).addMonth(2))),t.calendar("g").isAfter(new this.$persianDate(this.startDate[0]).addMonth(2))},e.prototype.getDatePickerLocale=function(t){this.dpLocale=t},e.prototype.rangeBegin=function(){this.$set(this.startDate,1,"")},Object.defineProperty(e.prototype,"endDate",{get:function(){return 0!=this.startDate.length?this.startDate[1]:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayEndDate",{get:function(){var t;if(this.endDate){var e="fa"==this.dpLocale?"jdddd jYYYY/jMM/jDD":"dddd YYYY/MM/DD";return null===(t=this.$options.filters)||void 0===t?void 0:t.simplePersian(new this.$persianDate(this.endDate).toString(e),this.dpLocale)}return""},enumerable:!1,configurable:!0}),e.prototype.getData=function(){var t=this;this.dataLoading=!0;var e=this.$store.state.baseUrl+"report/contract/cippricelist?StartDate=".concat(this.startDate.length>0?this.startDate[0]:"","&EndDate=").concat(this.endDate,"&ForAccountId=").concat(this.buyer&&this.buyer.hasOwnProperty("Id")&&this.buyer.Id?this.buyer.Id:-1);null!==this.reportTypeId&&(e+="&ReportType="+this.reportTypeId),null!==this.subsystemId&&(e+="&SubsystemId="+this.subsystemId),null!==this.flightTypeId&&(e+="&FlightType="+this.flightTypeId),null!==this.typePassengerId&&(e+="&AccountType="+this.typePassengerId),this.axios(e).then((function(e){t.financialReports=e.data.Items,t.dataLoading=!1,t.pageCount=e.data.PageIndexes})).catch((function(e){console.log(e),t.financialReports.splice(0),t.dataLoading=!1}))},e.prototype.getExcel=function(){var t=this;this.dataLoadingExcel=!0;var e=this.$store.state.baseUrl+"report/contract/cippricelist?StartDate=".concat(this.startDate.length>0?this.startDate[0]:"","&EndDate=").concat(this.endDate,"&ForAccountId=").concat(this.buyer&&this.buyer.hasOwnProperty("Id")&&this.buyer.Id?this.buyer.Id:-1);null!==this.reportTypeId&&(e+="&ReportType="+this.reportTypeId),null!==this.subsystemId&&(e+="&SubsystemId="+this.subsystemId),null!==this.flightTypeId&&(e+="&FlightType="+this.flightTypeId),null!==this.typePassengerId&&(e+="&AccountType="+this.typePassengerId),this.axios.get(e+="&Type=excel",{headers:{"Content-Disposition":"attachment; filename=template.xlsx","Content-Type":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},responseType:"arraybuffer"}).then((function(e){var a={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"},s=(new Date).toLocaleDateString("en-GB",a),n=new Blob([e.data],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"}),i=document.createElement("a");i.href=window.URL.createObjectURL(n),i.download="cipfinancialreport_".concat(s,".xlsx"),document.body.appendChild(i),i.click(),t.dataLoadingExcel=!1}))},e.prototype.sumField=function(t,e){return this.financialReports.reduce((function(a,s){return a+(s["Type"]===e?s[t]:0)}),0)},e.prototype.sumFieldBed=function(t){return this.financialReports.reduce((function(e,a){return e+(a[t]||0)}),0)},e.prototype.onBuyerChange=function(t){var e=this;t&&t.length>2?this.axios(this.$store.state.baseUrl+"user?q="+t).then((function(t){e.buyers=t.data.Items})):this.buyers=[]},e.prototype.searchAirlinesChanged=function(t){var e=this;t&&t.length>1&&this.axios(this.$store.state.baseUrl+"airlines?name="+t).then((function(t){t.data.Items.forEach((function(t,a){e.$set(t,"searchAirlines",t.name+t.iata)})),e.airlines=t.data.Items}))},x([Object(C["e"])("buyerInput")],e.prototype,"onBuyerChange",null),x([Object(C["e"])("searchAirlines")],e.prototype,"searchAirlinesChanged",null),e=x([Object(C["a"])({components:{datePicker:$["a"]}})],e),e}(C["d"]),I=k,w=I,T=(a("6b23"),a("2877")),P=Object(T["a"])(w,g,v,!1,null,"2cfb9470",null);e["default"]=P.exports}}]);