File: /home/slfopp7cb1df/www/inventorypacket.com/public/js/bundle/detail_quotation.8c074ad4fafc5fde.js
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8539],{21385:(t,e,s)=>{s.r(e),s.d(e,{default:()=>r});var n=s(95353),i=s(5947),a=s.n(i);const o={computed:(0,n.L8)(["currentUserPermissions","currentUser"]),metaInfo:{title:"Detail Quotation"},data:function(){return{isLoading:!0,quote:{},details:[],variants:[],company:{},email:{to:"",subject:"",message:"",client_name:"",Quote_Ref:""}}},methods:{print:function(){this.$htmlToPaper("print_Invoice")},Quote_PDF:function(){var t=this;a().start(),a().set(.1);var e=this.$route.params.id;axios.get("quote_pdf/".concat(e),{responseType:"blob",headers:{"Content-Type":"application/json"}}).then((function(e){var s=window.URL.createObjectURL(new Blob([e.data])),n=document.createElement("a");n.href=s,n.setAttribute("download","Quotation_"+t.quote.Ref+".pdf"),document.body.appendChild(n),n.click(),setTimeout((function(){return a().done()}),500)})).catch((function(){setTimeout((function(){return a().done()}),500)}))},formatNumber:function(t,e){var s=("string"==typeof t?t:t.toString()).split(".");if(e<=0)return s[0];var n=s[1]||"";if(n.length>e)return"".concat(s[0],".").concat(n.substr(0,e));for(;n.length<e;)n+="0";return"".concat(s[0],".").concat(n)},Get_Details:function(){var t=this,e=this.$route.params.id;axios.get("quotations/".concat(e)).then((function(e){t.quote=e.data.quote,t.details=e.data.details,t.company=e.data.company,t.isLoading=!1})).catch((function(e){setTimeout((function(){t.isLoading=!1}),500)}))},makeToast:function(t,e,s){this.$root.$bvToast.toast(e,{title:s,variant:t,solid:!0})},SendEmail:function(){var t=this;a().start(),a().set(.1);var e=this.$route.params.id;axios.post("quotations_send_email",{id:e,to:this.email.to,client_name:this.email.client_name,Ref:this.email.Quote_Ref}).then((function(e){setTimeout((function(){return a().done()}),500),t.makeToast("success",t.$t("Send.TitleEmail"),t.$t("Success"))})).catch((function(e){setTimeout((function(){return a().done()}),500),t.makeToast("danger",t.$t("SMTPIncorrect"),t.$t("Failed"))}))},Quote_SMS:function(){var t=this;a().start(),a().set(.1);var e=this.$route.params.id;axios.post("quotations_send_sms",{id:e}).then((function(e){setTimeout((function(){return a().done()}),500),t.makeToast("success",t.$t("Send_SMS"),t.$t("Success"))})).catch((function(e){setTimeout((function(){return a().done()}),500),t.makeToast("danger",t.$t("sms_config_invalid"),t.$t("Failed"))}))},Remove_Quote:function(){var t=this,e=this.$route.params.id;this.$swal({title:this.$t("Delete.Title"),text:this.$t("Delete.Text"),type:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",cancelButtonText:this.$t("Delete.cancelButtonText"),confirmButtonText:this.$t("Delete.confirmButtonText")}).then((function(s){s.value&&axios.delete("quotations/"+e).then((function(){t.$swal(t.$t("Delete.Deleted"),t.$t("Delete.QuoteDeleted"),"success"),t.$router.push({name:"index_quotation"})})).catch((function(){t.$swal(t.$t("Delete.Failed"),t.$t("Delete.Therewassomethingwronge"),"warning")}))}))}},created:function(){this.Get_Details()}};const r=(0,s(14486).A)(o,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-content"},[e("breadcumb",{attrs:{page:t.$t("DetailQuote"),folder:t.$t("ListQuotations")}}),t._v(" "),t.isLoading?e("div",{staticClass:"loading_page spinner spinner-primary mr-3"}):t._e(),t._v(" "),t.isLoading?t._e():e("b-card",[e("b-row",[e("b-col",{staticClass:"mb-5",attrs:{md:"12"}},[t.currentUserPermissions&&t.currentUserPermissions.includes("Quotations_edit")?e("router-link",{staticClass:"btn-sm btn btn-success ripple btn-icon m-1",attrs:{title:"Edit",to:{name:"edit_quotation",params:{id:t.$route.params.id}}}},[e("i",{staticClass:"i-Edit"}),t._v(" "),e("span",[t._v(t._s(t.$t("EditQuote")))])]):t._e(),t._v(" "),t.quote.statut&&t.currentUserPermissions&&t.currentUserPermissions.includes("Quotations_edit")?e("router-link",{staticClass:"btn-sm btn btn-primary ripple btn-icon m-1",attrs:{title:"Create",to:{name:"change_to_sale",params:{id:t.$route.params.id}}}},[e("i",{staticClass:"i-Add"}),t._v(" "),e("span",[t._v(t._s(t.$t("CreateSale")))])]):t._e(),t._v(" "),e("button",{staticClass:"btn-sm btn btn-info ripple btn-icon m-1",on:{click:function(e){return t.SendEmail()}}},[e("i",{staticClass:"i-Envelope-2"}),t._v("\n "+t._s(t.$t("Email"))+"\n ")]),t._v(" "),e("button",{staticClass:"btn btn-secondary btn-icon ripple btn-sm",on:{click:function(e){return t.Quote_SMS()}}},[e("i",{staticClass:"i-Speach-Bubble"}),t._v("\n SMS\n ")]),t._v(" "),e("button",{staticClass:"btn-sm btn btn-light ripple btn-icon m-1",on:{click:function(e){return t.Quote_PDF()}}},[e("i",{staticClass:"i-File-TXT"}),t._v(" PDF\n ")]),t._v(" "),e("button",{staticClass:"btn-sm btn btn-warning ripple btn-icon m-1",on:{click:function(e){return t.print()}}},[e("i",{staticClass:"i-Billing"}),t._v("\n "+t._s(t.$t("print"))+"\n ")]),t._v(" "),t.currentUserPermissions&&t.currentUserPermissions.includes("Quotations_delete")?e("button",{staticClass:"btn btn-danger btn-icon icon-left btn-sm m-1",on:{click:function(e){return t.Remove_Quote()}}},[e("i",{staticClass:"i-Close-Window"}),t._v("\n "+t._s(t.$t("Del"))+"\n ")]):t._e()],1)],1),t._v(" "),e("div",{staticClass:"invoice",attrs:{id:"print_Invoice"}},[e("div",{staticClass:"invoice-print"},[e("b-row",{staticClass:"justify-content-md-center"},[e("h4",{staticClass:"font-weight-bold"},[t._v(t._s(t.$t("DetailQuote"))+" : "+t._s(t.quote.Ref))])]),t._v(" "),e("hr"),t._v(" "),e("b-row",{staticClass:"mt-5"},[e("b-col",{staticClass:"mb-4",attrs:{md:"4"}},[e("h5",{staticClass:"font-weight-bold"},[t._v(t._s(t.$t("Customer_Info")))]),t._v(" "),e("div",[t._v(t._s(t.quote.client_name))]),t._v(" "),e("div",[t._v(t._s(t.quote.client_email))]),t._v(" "),e("div",[t._v(t._s(t.quote.client_phone))]),t._v(" "),e("div",[t._v(t._s(t.quote.client_adr))])]),t._v(" "),e("b-col",{staticClass:"mb-4",attrs:{md:"4"}},[e("h5",{staticClass:"font-weight-bold"},[t._v(t._s(t.$t("Company_Info")))]),t._v(" "),e("div",[t._v(t._s(t.company.CompanyName))]),t._v(" "),e("div",[t._v(t._s(t.company.email))]),t._v(" "),e("div",[t._v(t._s(t.company.CompanyPhone))]),t._v(" "),e("div",[t._v(t._s(t.company.CompanyAdress))])]),t._v(" "),e("b-col",{staticClass:"mb-4",attrs:{md:"4"}},[e("h5",{staticClass:"font-weight-bold"},[t._v(t._s(t.$t("Quote_Info")))]),t._v(" "),e("div",[t._v(t._s(t.$t("Reference"))+" : "+t._s(t.quote.Ref))]),t._v(" "),e("div",[t._v("\n "+t._s(t.$t("Status"))+" :\n "),"sent"==t.quote.statut?e("span",{staticClass:"badge badge-outline-success"},[t._v(t._s(t.$t("Sent")))]):e("span",{staticClass:"badge badge-outline-warning"},[t._v(t._s(t.$t("Pending")))])]),t._v(" "),e("div",[t._v(t._s(t.$t("date"))+" : "+t._s(t.quote.date))]),t._v(" "),e("div",[t._v(t._s(t.$t("warehouse"))+" : "+t._s(t.quote.warehouse))])])],1),t._v(" "),e("b-row",{staticClass:"mt-3"},[e("b-col",{attrs:{md:"12"}},[e("h5",{staticClass:"font-weight-bold"},[t._v(t._s(t.$t("Order_Summary")))]),t._v(" "),e("div",{staticClass:"table-responsive"},[e("table",{staticClass:"table table-hover table-md"},[e("thead",{staticClass:"bg-gray-300"},[e("tr",[e("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("ProductName")))]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("Net_Unit_Price")))]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("Quantity")))]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("UnitPrice")))]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("Discount")))]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("Tax")))]),t._v(" "),e("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("SubTotal")))])])]),t._v(" "),e("tbody",t._l(t.details,(function(s){return e("tr",[e("td",[e("span",[t._v(t._s(s.code)+" ("+t._s(s.name)+")")]),t._v(" "),e("p",{directives:[{name:"show",rawName:"v-show",value:s.is_imei&&null!==s.imei_number,expression:"detail.is_imei && detail.imei_number !==null "}]},[t._v(t._s(t.$t("IMEI_SN"))+" : "+t._s(s.imei_number))])]),t._v(" "),e("td",[t._v(t._s(t.currentUser.currency)+" "+t._s(t.formatNumber(s.Net_price,3)))]),t._v(" "),e("td",[t._v(t._s(t.formatNumber(s.quantity,2))+" "+t._s(s.unit_sale))]),t._v(" "),e("td",[t._v(t._s(t.currentUser.currency)+" "+t._s(t.formatNumber(s.price,2)))]),t._v(" "),e("td",[t._v(t._s(t.currentUser.currency)+" "+t._s(t.formatNumber(s.DiscountNet,2)))]),t._v(" "),e("td",[t._v(t._s(t.currentUser.currency)+" "+t._s(t.formatNumber(s.taxe,2)))]),t._v(" "),e("td",[t._v(t._s(t.currentUser.currency)+" "+t._s(s.total.toFixed(2)))])])})),0)])])]),t._v(" "),e("div",{staticClass:"offset-md-9 col-md-3 mt-4"},[e("table",{staticClass:"table table-striped table-sm"},[e("tbody",[e("tr",[e("td",{staticClass:"bold"},[t._v(t._s(t.$t("OrderTax")))]),t._v(" "),e("td",[e("span",[t._v(t._s(t.currentUser.currency)+" "+t._s(t.quote.TaxNet.toFixed(2))+" ("+t._s(t.formatNumber(t.quote.tax_rate,2))+" %)")])])]),t._v(" "),e("tr",[e("td",{staticClass:"bold"},[t._v(t._s(t.$t("Discount")))]),t._v(" "),e("td",[t._v(t._s(t.currentUser.currency)+" "+t._s(t.quote.discount.toFixed(2)))])]),t._v(" "),e("tr",[e("td",{staticClass:"bold"},[t._v(t._s(t.$t("Shipping")))]),t._v(" "),e("td",[t._v(t._s(t.currentUser.currency)+" "+t._s(t.quote.shipping.toFixed(2)))])]),t._v(" "),e("tr",[e("td",[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.$t("Total")))])]),t._v(" "),e("td",[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.currentUser.currency)+" "+t._s(t.quote.GrandTotal))])])])])])])],1),t._v(" "),e("hr",{directives:[{name:"show",rawName:"v-show",value:t.quote.note,expression:"quote.note"}]}),t._v(" "),e("b-row",{staticClass:"mt-4"},[e("b-col",{attrs:{md:"12"}},[e("p",[t._v(t._s(t.quote.note))])])],1)],1)])],1)],1)}),[],!1,null,null,null).exports}}]);