(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3ba0d011"],{"0cb2":function(t,a,n){"use strict";var e=n("e330"),r=n("7b0b"),s=Math.floor,o=e("".charAt),i=e("".replace),c=e("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,d=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,a,n,e,l,h){var p=n+t.length,f=e.length,m=d;return void 0!==l&&(l=r(l),m=u),i(h,m,(function(r,i){var u;switch(o(i,0)){case"$":return"$";case"&":return t;case"`":return c(a,0,n);case"'":return c(a,p);case"<":u=l[c(i,1,-1)];break;default:var d=+i;if(0===d)return r;if(d>f){var h=s(d/10);return 0===h?r:h<=f?void 0===e[h-1]?o(i,1):e[h-1]+o(i,1):r}u=e[d-1]}return void 0===u?"":u}))}},"14c3":function(t,a,n){"use strict";var e=n("c65b"),r=n("825a"),s=n("1626"),o=n("c6b6"),i=n("9263"),c=TypeError;t.exports=function(t,a){var n=t.exec;if(s(n)){var u=e(n,t,a);return null!==u&&r(u),u}if("RegExp"===o(t))return e(i,t,a);throw new c("RegExp#exec called on incompatible receiver")}},1583:function(t,a,n){"use strict";n("f516")},5319:function(t,a,n){"use strict";var e=n("2ba4"),r=n("c65b"),s=n("e330"),o=n("d784"),i=n("d039"),c=n("825a"),u=n("1626"),d=n("861d"),l=n("5926"),h=n("50c4"),p=n("577e"),f=n("1d80"),m=n("8aa5"),b=n("dc4a"),v=n("0cb2"),T=n("14c3"),$=n("b622"),g=$("replace"),k=Math.max,w=Math.min,y=s([].concat),x=s([].push),_=s("".indexOf),S=s("".slice),C=function(t){return void 0===t?t:String(t)},B=function(){return"$0"==="a".replace(/./,"$0")}(),D=function(){return!!/./[g]&&""===/./[g]("a","$0")}(),P=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}));o("replace",(function(t,a,n){var s=D?"$":"$0";return[function(t,n){var e=f(this),s=d(t)?b(t,g):void 0;return s?r(s,t,e,n):r(a,p(e),t,n)},function(t,r){var o=c(this),i=p(t);if("string"==typeof r&&-1===_(r,s)&&-1===_(r,"$<")){var d=n(a,o,i,r);if(d.done)return d.value}var f=u(r);f||(r=p(r));var b,$=o.global;$&&(b=o.unicode,o.lastIndex=0);var g,B=[];while(1){if(g=T(o,i),null===g)break;if(x(B,g),!$)break;var D=p(g[0]);""===D&&(o.lastIndex=m(i,h(o.lastIndex),b))}for(var P="",M=0,A=0;A=M&&(P+=S(i,M,q)+N,M=q+I.length)}return P+S(i,M)}]}),!P||!B||D)},"8aa5":function(t,a,n){"use strict";var e=n("6547").charAt;t.exports=function(t,a,n){return a+(n?e(t,a).length:1)}},"96da":function(t,a,n){},cf65:function(t,a,n){"use strict";n("96da")},d784:function(t,a,n){"use strict";n("ac1f");var e=n("c65b"),r=n("cb2d"),s=n("9263"),o=n("d039"),i=n("b622"),c=n("9112"),u=i("species"),d=RegExp.prototype;t.exports=function(t,a,n,l){var h=i(t),p=!o((function(){var a={};return a[h]=function(){return 7},7!==""[t](a)})),f=p&&!o((function(){var a=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[u]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return a=!0,null},n[h](""),!a}));if(!p||!f||n){var m=/./[h],b=a(h,""[t],(function(t,a,n,r,o){var i=a.exec;return i===s||i===d.exec?p&&!o?{done:!0,value:e(m,a,n,r)}:{done:!0,value:e(t,n,a,r)}:{done:!1}}));r(String.prototype,t,b[0]),r(d,h,b[1])}l&&c(d[h],"sham",!0)}},dc2f:function(t,a,n){"use strict";n.r(a);var e=function(){var t=this,a=t._self._c;return a("div",{staticClass:"main-content"},[a("breadcumb",{attrs:{page:"Edit Transaction",folder:"Transaction",link:"/app/transactions"}}),a("b-row",[a("b-col",{attrs:{md:"12"}},[a("b-overlay",{attrs:{show:t.show,rounded:"sm"}},[a("b-card",{ref:"formContainer"},[a("b-form",{on:{submit:function(a){return a.preventDefault(),t.handleUpdateTransaction.apply(null,arguments)}}},[a("b-form-group",{staticClass:"col-md-6 mb-3",attrs:{label:"Kode Transaksi"}},[a("b-form-input",{attrs:{type:"text",disabled:"",placeholder:"Kode Transaksi"},model:{value:t.dataTransaction.transactionCode,callback:function(a){t.$set(t.dataTransaction,"transactionCode",a)},expression:"dataTransaction.transactionCode"}})],1),a("b-form-group",{staticClass:"col-md-6 mb-3",attrs:{label:"Status Pembayaran"}},[a("multiselect",{attrs:{options:t.status,"custom-label":t.nameWithStatus,placeholder:"Search Status",label:"text","track-by":"text"},model:{value:t.dataTransaction.transactionStatus,callback:function(a){t.$set(t.dataTransaction,"transactionStatus",a)},expression:"dataTransaction.transactionStatus"}})],1),a("b-form-group",{staticClass:"col-md-6 mb-3",attrs:{label:"Metode Pembayaran"}},[a("multiselect",{attrs:{options:t.methodPayments,"custom-label":t.nameWithPayment,placeholder:"Search Via Pembayaran",label:"nameBank","track-by":"nameBank"},model:{value:t.dataTransaction.methodPayment,callback:function(a){t.$set(t.dataTransaction,"methodPayment",a)},expression:"dataTransaction.methodPayment"}})],1),a("b-form-group",{staticClass:"col-md-6 mb-3",attrs:{label:"Sub Total Pembayaran"}},[a("b-form-input",{staticClass:"input-nominal",attrs:{type:"text",placeholder:"0"},on:{input:t.handleInput,keypress:function(a){return t.handleBlockInputAlphabet(a)}},model:{value:t.dataTransaction.subTotal,callback:function(a){t.$set(t.dataTransaction,"subTotal",a)},expression:"dataTransaction.subTotal"}})],1),a("b-form-group",{staticClass:"col-md-6 mb-3",attrs:{label:"Nomor Unik"}},[a("b-form-input",{staticClass:"input-nominal",attrs:{type:"number",placeholder:"Masukkan Nomor Unik"},model:{value:t.dataTransaction.uniqueNumber,callback:function(a){t.$set(t.dataTransaction,"uniqueNumber",a)},expression:"dataTransaction.uniqueNumber"}})],1),a("b-col",{attrs:{md:"12"}},[a("b-button",{staticClass:"mt-3",attrs:{type:"submit",variant:"primary",disabled:t.show}},[t._v("Save ")])],1)],1)],1)],1)],1)],1)],1)},r=[],s=(n("99af"),n("14d9"),n("ac1f"),n("5319"),n("ce96")),o=n("8e5f"),i=n.n(o),c={components:{Multiselect:i.a},data:function(){return{show:!0,status:[{value:"done",text:"Selesai"},{value:"waiting",text:"Menunggu"},{value:"cancel",text:"Batal"},{value:"verifying",text:"Verifikasi"}],methodPayments:s["a"],dataTransaction:{transactionId:null,transactionCode:null,transaction_date:null,transactionStatus:{value:null},methodPayment:{id:null,nameBank:null},subTotal:null,uniqueNumber:null}}},watch:{value:{handler:function(t){this.dataTransaction.subTotal=this.format(t)},immediate:!0}},mounted:function(){"AA"===this.$store.getters.accountData.role?this.getDataTransaction():this.$router.push("/app/transactions")},methods:{nameWithPayment:function(t){var a=t.nameBank;return a},nameWithStatus:function(t){var a=t.text;return a},getDataTransaction:function(){var t=this;this.$http.get("".concat("https://orchestrator.bwa.id/api/v1/","transactions/").concat(this.$route.params.uuid),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(a){var n=a.data,e="";"waiting"===n.transaction_status?e="Menunggu":"done"===n.transaction_status?e="Selesai":"verifying"===n.transaction_status?e="Verifikasi":"cancel"===n.transaction_status&&(e="Batal"),t.dataTransaction={transactionId:n.transaction_id,transactionCode:n.transaction_code,transactionStatus:{value:n.transaction_status,text:e},methodPayment:{id:n.payment_channel_id,nameBank:n.payment_channel_name},transaction_date:n.transaction_date,subTotal:t.$formatPrice(n.sub_total),uniqueNumber:n.unique_number},t.show=!1})).catch((function(){t.show=!1,t.$store.dispatch("error","Maaf, terjadi kesalahan")}))},handleBlockInputAlphabet:function(t){t=t||window.event;var a=t.which?t.which:t.keyCode;if(!(a>31&&(a<48||a>57)&&46!==a))return!0;t.preventDefault()},format:function(t){return(t+"").replace(/\D/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,".")},handleInput:function(){this.dataTransaction.subTotal=this.format(this.dataTransaction.subTotal),this.$emit("input",(this.dataTransaction.subTotal+"").replace(/[^0-9]/g,""))},handleUpdateTransaction:function(){var t=this;this.show=!0;var a=this.$loading.show({container:this.$refs.formContainer});"cancel"===this.dataTransaction.transactionStatus.value?this.$http.post("".concat("https://orchestrator.bwa.id/api/v1/","donate/").concat(this.$route.params.uuid,"/cancel"),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(n){a.hide(),t.show=!1,t.$store.dispatch("success","Data transkasi berhasil diubah"),t.getDataTransaction()})).catch((function(n){a.hide(),t.show=!1,t.$store.dispatch("error",n)})):"verifying"===this.dataTransaction.transactionStatus.value?this.$http.post("".concat("https://orchestrator.bwa.id/api/v1/","donate/").concat(this.$route.params.uuid,"/verifying"),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(){a.hide(),t.show=!1,t.$store.dispatch("success","Data transkasi berhasil diubah"),t.getDataTransaction()})).catch((function(n){a.hide(),t.show=!1,t.$store.dispatch("error",n)})):"done"===this.dataTransaction.transactionStatus.value&&this.$http.post("".concat("https://orchestrator.bwa.id/api/v1/","donate/").concat(this.$route.params.uuid,"/done"),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(){a.hide(),t.show=!1,t.$store.dispatch("success","Data transkasi berhasil diubah"),t.getDataTransaction()})).catch((function(n){a.hide(),t.show=!1,t.$store.dispatch("error",n)})),this.$http.patch("".concat("https://orchestrator.bwa.id/api/v1/","transactions/").concat(this.$route.params.uuid),{transaction_date:this.$moment(this.dataTransaction.transaction_date).format("Y-MM-DD")+" 00:00",payment_channel_id:this.dataTransaction.methodPayment.id,sub_total:this.dataTransaction.subTotal.replace(/(\d)[\s.]+(?=\d)/g,"$1"),unique_number:this.dataTransaction.uniqueNumber},{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(){a.hide(),"done"==t.dataTransaction.transactionStatus.value?t.handleResendNotification():(t.show=!1,t.$store.dispatch("success","Transaksi berhasil diubah"),t.getDataTransaction())})).catch((function(){t.show=!1,a.hide(),t.$store.dispatch("error","Maaf, terjadi kesalahan")}))},handleResendNotification:function(){var t=this;this.$http.post("".concat("https://orchestrator.bwa.id/api/v1/","transactions/").concat(this.$route.params.uuid,"/resend-notification"),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(a){var n=a.data;t.show=!1,t.$router.push("/app/transactions/detail/".concat(n.transaction_id)),t.$store.dispatch("success","Transaksi berhasil diubah")})).catch((function(){t.show=!1,t.$store.dispatch("error","Maaf, terjadi kesalahan")}))}}},u=c,d=(n("cf65"),n("1583"),n("2877")),l=Object(d["a"])(u,e,r,!1,null,"03858a5a",null);a["default"]=l.exports},f516:function(t,a,n){}}]);