⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
qda-digital.online
/
public
/
dist
/
js
/
Edit File: 45.135589.js
/*! For license information please see 45.135589.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[45],{364:function(t,e,r){"use strict";r.r(e);var o=r(4),a=r(7),n=r.n(a),i=r(3),s=r(141),c=r.n(s),l=r(512),u=r.n(l),d=r(22),m=r(193);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(){p=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},n=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,a){var n=e&&e.prototype instanceof m?e:m,i=Object.create(n.prototype),s=new T(a||[]);return o(i,"_invoke",{value:C(t,r,s)}),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var d={};function m(){}function v(){}function h(){}var g={};c(g,n,(function(){return this}));var b=Object.getPrototypeOf,y=b&&b(b(S([])));y&&y!==e&&r.call(y,n)&&(g=y);var _=h.prototype=m.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var a;o(this,"_invoke",{value:function(o,n){function i(){return new e((function(a,i){!function o(a,n,i,s){var c=u(t[a],t,n);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==f(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):e.resolve(d).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,s)}))}s(c.arg)}(o,n,a,i)}))}return a=a?a.then(i,i):i()}})}function C(t,e,r){var o="suspendedStart";return function(a,n){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===a)throw n;return N()}for(r.method=a,r.arg=n;;){var i=r.delegate;if(i){var s=P(i,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var c=u(t,e,r);if("normal"===c.type){if(o=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o="completed",r.method="throw",r.arg=c.arg)}}}function P(t,e){var r=e.method,o=t.iterator[r];if(void 0===o)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,d;var n=a.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function S(t){if(t){var e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(r.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=h,o(_,"constructor",{value:h,configurable:!0}),o(h,"constructor",{value:v,configurable:!0}),v.displayName=c(h,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},x(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,o,a,n){void 0===n&&(n=Promise);var i=new w(l(e,r,o,a),n);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(_),c(_,s,"Generator"),c(_,n,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},t.values=S,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(r,o){return i.type="throw",i.arg=t,e.next=r,o&&(e.method="next",e.arg=void 0),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a],i=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var s=r.call(n,"catchLoc"),c=r.call(n,"finallyLoc");if(s&&c){if(this.prev<n.catchLoc)return o(n.catchLoc,!0);if(this.prev<n.finallyLoc)return o(n.finallyLoc)}else if(s){if(this.prev<n.catchLoc)return o(n.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return o(n.finallyLoc)}}}},abrupt:function(t,e){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var n=a;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var i=n?n.completion:{};return i.type=t,i.arg=e,n?(this.method="next",this.next=n.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function v(t,e,r,o,a,n,i){try{var s=t[n](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(o,a)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var n=t.apply(e,r);function i(t){v(n,o,a,i,s,"next",t)}function s(t){v(n,o,a,i,s,"throw",t)}i(void 0)}))}}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function b(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==f(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==f(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===f(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var y={middleware:["auth","check-permissions"],components:{ModalMini:r(139).a},metaInfo:function(){return{title:this.$t("products.list.create.page_title")}},data:function(){return{showProductCreateModal:!1,form:new o.a({itemName:"",itemCode:"",itemModel:"",barcodeSymbology:"CODE128",subCategory:"",brand:"",itemUnit:"",productTax:"",taxType:"Exclusive",regularPrice:"",discount:"",sellingPrice:"",note:"",alertQuantity:1,status:1,image:""}),options:[],units:[],brands:[],taxes:[],prefix:"",url:null}},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){b(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(i.b)("operations",["items","appInfo"])),created:function(){this.getSubCatgories(),this.getUnits(),this.getBrands(),this.getTaxes(),this.getItemCode()},methods:{getSubCatgories:function(){var t=this;return h(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("operations/allData",{path:"/api/all-product-sub-categories"});case 2:case"end":return e.stop()}}),e)})))()},getBrands:function(){var t=this;return h(p().mark((function e(){var r,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/all-brands");case 2:r=e.sent,o=r.data,t.brands=o.data;case 5:case"end":return e.stop()}}),e)})))()},getUnits:function(){var t=this;return h(p().mark((function e(){var r,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/all-units");case 2:r=e.sent,o=r.data,t.units=o.data;case 5:case"end":return e.stop()}}),e)})))()},getTaxes:function(){var t=this;return h(p().mark((function e(){var r,o,a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/all-vat-rates");case 2:r=e.sent,o=r.data,t.taxes=o.data,t.taxes&&t.taxes.length>0&&(a=t.appInfo.defaultVatRateSlug,t.form.productTax=t.taxes.find((function(t){return t.slug===a}))),t.calculatePrice();case 7:case"end":return e.stop()}}),e)})))()},getItemCode:function(){var t=this;return h(p().mark((function e(){var r,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/generate-itemcode");case 2:r=e.sent,o=r.data,t.form.itemCode=o.code,t.prefix=o.prefix;case 6:case"end":return e.stop()}}),e)})))()},calculatePrice:function(){if(this.form.sellingPrice&&this.form.productTax&&this.form.taxType){var t=0;this.form.discount&&this.form.discount>0&&(t=this.form.discount/100*this.form.regularPrice);var e=this.form.regularPrice-t,r=0,o=0;return this.form.productTax.rate>0&&(r=this.form.productTax.rate/100),o="Exclusive"==this.form.taxType?e*r:e-e/(1+r),void("Exclusive"==this.form.taxType?this.form.sellingPrice=this.form.regularPrice-t+o:this.form.sellingPrice=(this.form.regularPrice-t)/(1+r)+o)}return this.form.sellingPrice=this.form.regularPrice},onFileChange:function(t){var e=this,r=t.target.files[0],o=new FileReader;r.size<2111775&&("image/jpeg"===r.type||"image/png"===r.type||"image/gif"===r.type)?(o.onloadend=function(t){e.form.image=o.result},o.readAsDataURL(r),this.url=URL.createObjectURL(r)):Swal.fire(this.$t("common.error"),this.$t("common.image_error"),"error")},saveProduct:function(){var t=this;return h(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.post(window.location.origin+"/api/products").then((function(){toast.fire({type:"success",title:t.$t("products.list.create.success_msg")}),t.form.reset(),t.showProductCreateModal=!1,t.$emit("reloadProducts")})).catch((function(){toast.fire({type:"error",title:t.$t("common.error_msg")})}));case 2:case"end":return e.stop()}}),e)})))()}}},_=(r(617),r(1)),x=Object(_.a)(y,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"pl-1"},[r("a",{staticClass:"create-button",on:{click:function(e){t.showProductCreateModal=!t.showProductCreateModal}}},[r("i",{staticClass:"fas fa-solid fa-plus-circle"})])]),t._v(" "),r("ModalMini",{directives:[{name:"show",rawName:"v-show",value:t.showProductCreateModal,expression:"showProductCreateModal"}]},[r("h5",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t._v("\n "+t._s(t.$t("Create Product"))+"\n ")]),t._v(" "),r("div",{staticClass:"w-100",attrs:{slot:"body"},slot:"body"},[r("form",{attrs:{role:"form"},on:{submit:function(e){return e.preventDefault(),t.saveProduct.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[r("div",{staticClass:"card-body"},[r("div",{staticClass:"row"},[r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"itemName"}},[t._v(t._s(t.$t("common.item_name"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.itemName,expression:"form.itemName"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("itemName")},attrs:{id:"itemName",type:"text",name:"itemName",placeholder:t.$t("common.item_name_placeholder")},domProps:{value:t.form.itemName},on:{input:function(e){e.target.composing||t.$set(t.form,"itemName",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"itemName"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"itemModel"}},[t._v(t._s(t.$t("common.item_model")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.itemModel,expression:"form.itemModel"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("itemModel")},attrs:{id:"itemModel",type:"text",name:"itemModel",placeholder:t.$t("common.item_model_placeholder")},domProps:{value:t.form.itemModel},on:{input:function(e){e.target.composing||t.$set(t.form,"itemModel",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"itemModel"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("div",{staticClass:"input-group"},[r("label",{staticClass:"col-md-12",attrs:{for:"itemCode"}},[t._v(t._s(t.$t("common.item_code"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("div",{staticClass:"input-group-prepend"},[t.prefix?r("span",{staticClass:"input-group-text",attrs:{id:"basic-addon1"}},[t._v(t._s(t.prefix))]):t._e()]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.itemCode,expression:"form.itemCode"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("itemCode")},attrs:{type:"text",name:"itemCode",placeholder:t.$t("common.item_code_placeholder"),"aria-label":"itemCode","aria-describedby":"basic-addon1"},domProps:{value:t.form.itemCode},on:{input:function(e){e.target.composing||t.$set(t.form,"itemCode",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"itemCode"}})],1)]),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"barcodeSymbology"}},[t._v(t._s(t.$t("products.list.common.barcode_symbology"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("select",{directives:[{name:"model",rawName:"v-model",value:t.form.barcodeSymbology,expression:"form.barcodeSymbology"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("barcodeSymbology")},attrs:{id:"barcodeSymbology"},on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,"barcodeSymbology",e.target.multiple?r:r[0])}}},[r("option",{attrs:{value:"CODE128"}},[t._v("CODE128")]),t._v(" "),r("option",{attrs:{value:"CODE39"}},[t._v("CODE39")]),t._v(" "),r("option",{attrs:{value:"EAN8"}},[t._v("EAN8")]),t._v(" "),r("option",{attrs:{value:"EAN13"}},[t._v("EAN13")]),t._v(" "),r("option",{attrs:{value:"UPC"}},[t._v("UPC")])]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"barcodeSymbology"}})],1),t._v(" "),t.items?r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"subCategory"}},[t._v(t._s(t.$t("common.sub_category"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("v-select",{class:{"is-invalid":t.form.errors.has("subCategory")},attrs:{options:t.items,label:"name",name:"subCategory",placeholder:t.$t("common.category_name_placeholder")},model:{value:t.form.subCategory,callback:function(e){t.$set(t.form,"subCategory",e)},expression:"form.subCategory"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"subCategory"}})],1):t._e(),t._v(" "),t.brands?r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"brand"}},[t._v(t._s(t.$t("common.brand")))]),t._v(" "),r("v-select",{class:{"is-invalid":t.form.errors.has("brand")},attrs:{options:t.brands,label:"name",name:"brand",placeholder:t.$t("common.brand_placeholder")},model:{value:t.form.brand,callback:function(e){t.$set(t.form,"brand",e)},expression:"form.brand"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"brand"}})],1):t._e(),t._v(" "),t.units?r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"itemUnit"}},[t._v(t._s(t.$t("common.unit"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("v-select",{class:{"is-invalid":t.form.errors.has("itemUnit")},attrs:{options:t.units,label:"name",name:"itemUnit",placeholder:t.$t("common.unit_placeholder")},model:{value:t.form.itemUnit,callback:function(e){t.$set(t.form,"itemUnit",e)},expression:"form.itemUnit"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"itemUnit"}})],1):t._e(),t._v(" "),t.taxes?r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"productTax"}},[t._v(t._s(t.$t("products.list.common.product_tax"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("v-select",{class:{"is-invalid":t.form.errors.has("productTax")},attrs:{options:t.taxes,label:"code",name:"productTax",placeholder:t.$t("products.list.common.tax_placeholder")},on:{input:t.calculatePrice},model:{value:t.form.productTax,callback:function(e){t.$set(t.form,"productTax",e)},expression:"form.productTax"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"productTax"}})],1):t._e(),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"taxType"}},[t._v(t._s(t.$t("products.list.common.tax_type"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("select",{directives:[{name:"model",rawName:"v-model",value:t.form.taxType,expression:"form.taxType"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("taxType")},attrs:{id:"taxType"},on:{change:[function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,"taxType",e.target.multiple?r:r[0])},t.calculatePrice]}},[r("option",{attrs:{value:"Exclusive"}},[t._v("\n "+t._s(t.$t("products.list.common.exclusive"))+"\n ")]),t._v(" "),r("option",{attrs:{value:"Inclusive"}},[t._v("\n "+t._s(t.$t("products.list.common.inclusive"))+"\n ")])]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"taxType"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"regularPrice"}},[t._v(t._s(t.$t("products.list.common.regular_price"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.regularPrice,expression:"form.regularPrice"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("regularPrice")},attrs:{id:"regularPrice",type:"number",step:"any",min:"0",name:"regularPrice",placeholder:t.$t("products.list.common.regular_price_placeholder")},domProps:{value:t.form.regularPrice},on:{change:t.calculatePrice,keyup:t.calculatePrice,input:function(e){e.target.composing||t.$set(t.form,"regularPrice",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"regularPrice"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("div",{staticClass:"input-group"},[r("label",{staticClass:"col-md-12",attrs:{for:"discount"}},[t._v(t._s(t.$t("common.discount")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.discount,expression:"form.discount"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("discount")},attrs:{type:"number",min:"0",max:"100",name:"discount",placeholder:t.$t("common.discount_placeholder"),"aria-label":"discount","aria-describedby":"basic-addon1"},domProps:{value:t.form.discount},on:{change:t.calculatePrice,keyup:t.calculatePrice,input:function(e){e.target.composing||t.$set(t.form,"discount",e.target.value)}}}),t._v(" "),r("div",{staticClass:"input-group-prepend"},[r("span",{staticClass:"input-group-text",attrs:{id:"basic-addon1"}},[t._v("%")])]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"discount"}})],1)]),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"sellingPrice"}},[t._v(t._s(t.$t("products.list.common.selling_price")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.sellingPrice,expression:"form.sellingPrice"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("sellingPrice")},attrs:{id:"sellingPrice",type:"number",readonly:"",name:"sellingPrice",placeholder:t.$t("products.list.common.selling_price_placeholder")},domProps:{value:t.form.sellingPrice},on:{input:function(e){e.target.composing||t.$set(t.form,"sellingPrice",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"sellingPrice"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"note"}},[t._v(t._s(t.$t("common.note")))]),t._v(" "),r("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.note,expression:"form.note"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("note")},attrs:{id:"note",type:"text",name:"companyName",placeholder:t.$t("common.note_placeholder")},domProps:{value:t.form.note},on:{input:function(e){e.target.composing||t.$set(t.form,"note",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"note"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"alertQuantity"}},[t._v(t._s(t.$t("products.list.common.alert_quantity"))+"\n ")]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.alertQuantity,expression:"form.alertQuantity"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("alertQuantity")},attrs:{id:"alertQuantity",type:"number",min:"0",max:"1000",name:"alertQuantity",placeholder:t.$t("products.list.common.alert_quantity_placeholder")},domProps:{value:t.form.alertQuantity},on:{input:function(e){e.target.composing||t.$set(t.form,"alertQuantity",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"alertQuantity"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"status"}},[t._v(t._s(t.$t("common.status")))]),t._v(" "),r("select",{directives:[{name:"model",rawName:"v-model",value:t.form.status,expression:"form.status"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("status")},attrs:{id:"status"},on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,"status",e.target.multiple?r:r[0])}}},[r("option",{attrs:{value:"1"}},[t._v("\n "+t._s(t.$t("common.active"))+"\n ")]),t._v(" "),r("option",{attrs:{value:"0"}},[t._v("\n "+t._s(t.$t("common.in_active"))+"\n ")])]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"status"}})],1),t._v(" "),r("div",{staticClass:"form-group col-12"},[r("label",{attrs:{for:"image"}},[t._v(t._s(t.$t("common.image")))]),t._v(" "),r("div",{staticClass:"custom-file"},[r("input",{staticClass:"custom-file-input",class:{"is-invalid":t.form.errors.has("image")},attrs:{id:"image",type:"file",name:"image"},on:{change:t.onFileChange}}),t._v(" "),r("label",{staticClass:"custom-file-label",attrs:{for:"image"}},[t._v(t._s(t.$t("common.choose_file")))])]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"image"}}),t._v(" "),r("div",{staticClass:"bg-light mt-4 w-25"},[t.url?r("img",{staticClass:"img-fluid",attrs:{src:t.url,alt:t.$t("common.image_alt")}}):t._e()])],1)])]),t._v(" "),r("div",{staticClass:"card-footer d-flex justify-content-between px-5"},[r("v-button",{staticClass:"btn btn-primary",attrs:{loading:t.form.busy}},[r("i",{staticClass:"fas fa-save"}),t._v(" "+t._s(t.$t("common.save"))+"\n ")]),t._v(" "),r("button",{staticClass:"btn btn-secondary float-right",attrs:{type:"reset"},on:{click:function(e){return t.form.reset()}}},[r("i",{staticClass:"fas fa-power-off"}),t._v(" "+t._s(t.$t("common.reset"))+"\n ")]),t._v(" "),r("button",{staticClass:"btn btn-secondary",on:{click:function(e){t.showProductCreateModal=!1}}},[t._v("\n "+t._s(t.$t("Cancel"))+"\n ")])],1)])])])],1)}),[],!1,null,"0456f1cb",null).exports;function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(){C=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},n=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,a){var n=e&&e.prototype instanceof m?e:m,i=Object.create(n.prototype),s=new T(a||[]);return o(i,"_invoke",{value:x(t,r,s)}),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var d={};function m(){}function f(){}function p(){}var v={};c(v,n,(function(){return this}));var h=Object.getPrototypeOf,g=h&&h(h(S([])));g&&g!==e&&r.call(g,n)&&(v=g);var b=p.prototype=m.prototype=Object.create(v);function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){var a;o(this,"_invoke",{value:function(o,n){function i(){return new e((function(a,i){!function o(a,n,i,s){var c=u(t[a],t,n);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==w(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):e.resolve(d).then((function(t){l.value=t,i(l)}),(function(t){return o("throw",t,i,s)}))}s(c.arg)}(o,n,a,i)}))}return a=a?a.then(i,i):i()}})}function x(t,e,r){var o="suspendedStart";return function(a,n){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===a)throw n;return N()}for(r.method=a,r.arg=n;;){var i=r.delegate;if(i){var s=P(i,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var c=u(t,e,r);if("normal"===c.type){if(o=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o="completed",r.method="throw",r.arg=c.arg)}}}function P(t,e){var r=e.method,o=t.iterator[r];if(void 0===o)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var a=u(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,d;var n=a.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function S(t){if(t){var e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(r.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:N}}function N(){return{value:void 0,done:!0}}return f.prototype=p,o(b,"constructor",{value:p,configurable:!0}),o(p,"constructor",{value:f,configurable:!0}),f.displayName=c(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(_.prototype),c(_.prototype,i,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,o,a,n){void 0===n&&(n=Promise);var i=new _(l(e,r,o,a),n);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},y(b),c(b,s,"Generator"),c(b,n,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},t.values=S,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(r,o){return i.type="throw",i.arg=t,e.next=r,o&&(e.method="next",e.arg=void 0),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a],i=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var s=r.call(n,"catchLoc"),c=r.call(n,"finallyLoc");if(s&&c){if(this.prev<n.catchLoc)return o(n.catchLoc,!0);if(this.prev<n.finallyLoc)return o(n.finallyLoc)}else if(s){if(this.prev<n.catchLoc)return o(n.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return o(n.finallyLoc)}}}},abrupt:function(t,e){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var n=a;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var i=n?n.completion:{};return i.type=t,i.arg=e,n?(this.method="next",this.next=n.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var a=o.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function P(t,e,r,o,a,n,i){try{var s=t[n](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(o,a)}function $(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var n=t.apply(e,r);function i(t){P(n,o,a,i,s,"next",t)}function s(t){P(n,o,a,i,s,"throw",t)}i(void 0)}))}}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function T(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==w(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==w(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===w(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var S={middleware:["auth"],metaInfo:function(){return{title:this.$t("pos.page_title")}},components:{Modal:d.a,barcode:c.a,ClientCreateModal:m.a,ProductCreateModal:x},data:function(){return{breadcrumbsCurrent:"pos.breadcrumbs_current",breadcrumbs:[{name:"pos.breadcrumbs_first",url:"home"},{name:"pos.breadcrumbs_second",url:"invoices.index"},{name:"pos.breadcrumbs_active",url:""}],form:new o.a({invoiceNo:"",client:"",reference:"",selectedProducts:[],subTotal:0,netTotal:0,discountType:0,discount:"",totalDiscount:"",transportCost:"",orderTax:"",totalTax:0,productTotalTax:0,account:"",totalPaid:"",dueAmount:"",poReference:"",paymentTerms:"",deliveryPlace:"",addPayment:"",chequeNo:"",receiptNo:"",date:(new Date).toISOString().slice(0,10),note:"",status:1,category:"",invoice_id:null,invoice_slug:null}),taxes:[],audio:"",products:"",accounts:"",categories:[],subCategories:[],productPrefix:"",invoicePrefix:"",showModal:!1,allData:{},showSmallInvoiceModal:!1,printMe:!1,perPage:10,pagination:"",query:"",generateOrder:!1,clickCount:0,clients:[]}},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(i.b)("operations",["items","appInfo"])),mounted:function(){var t=this;window.addEventListener("keypress",(function(e){t.form.netTotal>0&&0==t.showModal&&0==t.generateOrder&&"Enter"===e.key&&(t.generateOrder=!0,t.completeOrderAndAddPayment()),t.form.netTotal>0&&t.form.paidAmount>0&&1==t.generateOrder&&"Enter"===e.key&&(t.clickCount++,t.showModal=!1,console.log("from second click",t.clickCount),1==t.clickCount?t.addPayment():t.printInvoice())}))},created:function(){this.getClients(),this.getProducts(),this.getAccounts(),this.getTaxes(),this.getCategories(),this.getSubCategories(),this.audio=new Audio(u.a),this.productPrefix=this.appInfo.productPrefix,this.invoicePrefix=this.appInfo.invoicePrefix,document.body.classList.add("sidebar-collapse")},watch:{query:function(t,e){""==t?this.getProducts():this.searchProducts()}},methods:{doThis:function(){console.log("do this")},getClients:function(){var t=this;return $(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.a.get("/api/all-clients").then((function(e){var r=e.data;if(t.clients=r.data,t.clients&&t.clients.length>0){var o=t.appInfo.defaultClientSlug;t.form.client=t.items.find((function(t){return t.slug===o}))}})).catch((function(t){return console.log(t)}));case 2:case"end":return e.stop()}}),e)})))()},getAccounts:function(){var t=this;return $(C().mark((function e(){var r,o,a;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/all-accounts");case 2:r=e.sent,o=r.data,t.accounts=o.data,t.accounts&&t.accounts.length>0&&(a=t.appInfo.defaultAccountSlug,t.form.account=t.accounts.find((function(t){return t.slug==a})));case 6:case"end":return e.stop()}}),e)})))()},getTaxes:function(){var t=this;return $(C().mark((function e(){var r,o,a;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/all-vat-rates");case 2:r=e.sent,o=r.data,t.taxes=o.data,t.taxes&&t.taxes.length>0&&(a=t.appInfo.defaultVatRateSlug,t.form.orderTax=t.taxes.find((function(t){return t.slug===a})));case 6:case"end":return e.stop()}}),e)})))()},getCategories:function(){var t=this;return $(C().mark((function e(){var r,o;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/all-product-categories");case 2:r=e.sent,o=r.data,t.categories=o.data;case 5:case"end":return e.stop()}}),e)})))()},getSubCategories:function(){var t=this;return $(C().mark((function e(){var r,o;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get(window.location.origin+"/api/all-product-sub-categories");case 2:r=e.sent,o=r.data,t.subCategories=o.data;case 5:case"end":return e.stop()}}),e)})))()},getInvoice:function(t){var e=this;return $(C().mark((function r(){var o,a;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.loading=!0,r.next=3,n.a.get(window.location.origin+"/api/invoices/"+t);case 3:o=r.sent,a=o.data,e.allData=a.data,e.invoiceProducts=e.allData.invoiceProducts,e.invoiceProducts.sort(e.sortProducts),e.loading=!1;case 9:case"end":return r.stop()}}),r)})))()},getProducts:function(){var t=this;return $(C().mark((function e(){var r,o,a;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.pagination?t.pagination.current_page:1,e.next=3,t.form.get(window.location.origin+"/api/all-products-paginated?page="+r);case 3:o=e.sent,a=o.data,t.products=a.data,t.products.sort(t.sortProducts),t.pagination=a.meta;case 8:case"end":return e.stop()}}),e)})))()},sortProducts:function(t,e){return Number(t.code)<Number(e.code)?-1:Number(t.code)>Number(e.code)?1:0},getSubCategoriesByCategory:function(){var t=this;return $(C().mark((function e(){var r,o,a,i,s;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.pagination?t.pagination.current_page:1,t.subCategories=[],t.form.subCategory="",!(a=null===(r=t.form.category)||void 0===r?void 0:r.slug)){e.next=13;break}return e.next=7,n.a.get(window.location.origin+"/api/all-pro-sub-categories-by-category/"+a+"?page="+o);case 7:i=e.sent,s=i.data,t.subCategories=s.cats,t.products=s.products,e.next=17;break;case 13:return e.next=15,t.getSubCategories();case 15:return e.next=17,t.getProducts();case 17:case"end":return e.stop()}}),e)})))()},getProductsBySubCategory:function(){var t=this;return $(C().mark((function e(){var r,o,a,i,s,c,l;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.pagination?t.pagination.current_page:1,t.products=[],t.form.itemName="",i=null===(r=t.form.category)||void 0===r?void 0:r.slug,s=null===(o=t.form.subCategory)||void 0===o?void 0:o.slug,!i||!s){e.next=14;break}return e.next=8,n.a.get(window.location.origin+"/api/all-products-by-sub-categories/"+i+"/"+s+"?page="+a);case 8:c=e.sent,l=c.data,t.products=l.data,t.pagination=l.meta,e.next=16;break;case 14:return e.next=16,t.getProducts();case 16:case"end":return e.stop()}}),e)})))()},paginate:function(){var t=this;return $(C().mark((function e(){var r,o,a,n;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null===(r=t.form.category)||void 0===r?void 0:r.slug,n=null===(o=t.form.subCategory)||void 0===o?void 0:o.slug,""!==t.query){e.next=17;break}if(!a){e.next=8;break}return e.next=6,t.getSubCategoriesByCategory();case 6:e.next=15;break;case 8:if(!a||!n){e.next=13;break}return e.next=11,t.getProductsBySubCategory();case 11:e.next=15;break;case 13:return e.next=15,t.getProducts();case 15:e.next=19;break;case 17:return e.next=19,t.searchProducts();case 19:case"end":return e.stop()}}),e)})))()},resetPagination:function(){var t=this;return $(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.pagination&&(t.pagination.current_page=1),e.next=3,t.searchProducts();case 3:case"end":return e.stop()}}),e)})))()},searchProducts:function(){var t=this;return $(C().mark((function e(){var r,o,a,n,i;return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.form.category?t.form.category.slug:"",o=t.form.subCategory?t.form.subCategory.slug:"",t.$store.state.operations.loading=!0,a=t.pagination?t.pagination.current_page:1,e.next=6,t.form.get(window.location.origin+"/api/products/search-from-pos?term="+t.query+"&page="+a+"&perPage="+t.perPage+"&catSlug="+r+"&SubCatSlug="+o);case 6:n=e.sent,i=n.data,t.products=i.data,t.products.sort(t.sortProducts),t.pagination=i.meta,console.log(t.pagination);case 12:case"end":return e.stop()}}),e)})))()},reload:function(){var t=this;return $(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.query="",e.next=3,t.searchProducts();case 3:case"end":return e.stop()}}),e)})))()},storeProduct:function(t){var e=this.form.selectedProducts.findIndex((function(e){return e.id==t.id})),r=1;if(t.inventoryCount>=r){if(-1!==e){r=this.form.selectedProducts[e].qty,this.audio.play(),this.generateItemTotal(r,"qty",e,"increment");var o=this.form.selectedProducts[e].unitPrice;return void this.generateItemTotal(o,"price",e,"increment")}var a="Exclusive"==t.taxType?t.priceWithDiscount*(t.taxRate/100):t.priceWithDiscount-t.priceWithDiscount/(1+t.taxRate/100),n=a*r;this.form.selectedProducts.unshift({id:t.id,slug:t.slug,name:t.name,code:t.code,taxType:t.taxType,taxRate:t.taxRate,qty:r,inventoryCount:t.inventoryCount,avgPurchasePrice:t.avgPurchasePrice,unitPrice:t.priceWithDiscount,unitCost:"Exclusive"==t.taxType?t.priceWithDiscount+a:t.priceWithDiscount,totalPrice:"Exclusive"==t.taxType?1*(t.priceWithDiscount+n):1*t.priceWithDiscount,productTax:t.productTax>0?t.productTax:0,totalTax:n}),this.audio.play()}else toast.fire({type:"error",title:this.$t("common.insufficient_stock")});this.generateItemTotal(r,"qty",e,"")},generateItemTotal:function(t,e,r,o){var a=this.form.selectedProducts[r];a&&("qty"==e?(a.qty=t,a.inventoryCount>=t?"increment"==o?a.qty=Number(a.qty)+1:"decrement"==o&&(a.qty=Number(a.qty)-1):(a.qty=1,toast.fire({type:"error",title:this.$t("pos.not_enough_items")}))):(a.unitPrice=t,("increment"==o||"decrement"==o&&a.unitPrice>0)&&(a.unitPrice=Number(a.unitPrice))),a.productTax="Exclusive"==a.taxType?a.unitPrice*(a.taxRate/100):a.unitPrice-a.unitPrice/(1+a.taxRate/100),a.totalTax=a.productTax*a.qty,a.totalPrice="Exclusive"==a.taxType?a.qty*a.unitPrice+a.totalTax:a.qty*a.unitPrice,a.unitCost="Exclusive"==a.taxType?Number(a.unitPrice)+Number(a.productTax):a.unitPrice,this.form.selectedProducts[r]=a),this.calculateSum()},removeItem:function(t){var e=this.form.selectedProducts.indexOf(t);e>-1&&this.form.selectedProducts.splice(e,1),this.calculateSum()},calculateSum:function(){if(this.form.subTotal=this.form.selectedProducts.reduce((function(t,e){return Number((t+e.totalPrice).toFixed(2))}),0),this.form.productTotalTax=this.form.selectedProducts.reduce((function(t,e){return Number((t+e.totalTax).toFixed(2))}),0),this.form.netTotal=this.form.subTotal,this.form.totalTax=0,this.form.orderTax&&(this.form.totalTax=this.form.orderTax.rate/100*this.form.subTotal),this.form.subTotal>0){var t=Number(this.form.discount);1==this.form.discountType?(t=t/100*this.form.subTotal,this.form.totalDiscount=Number(t.toFixed(2))):t=Number(this.form.discount),this.form.netTotal=this.form.subTotal+Number(this.form.transportCost)-t+this.form.totalTax}},saveInvoice:function(){var t=arguments,e=this;return $(C().mark((function r(){var o;return C().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=!(t.length>0&&void 0!==t[0])||t[0],r.next=3,e.form.post(window.location.origin+"/api/invoices").then((function(t){var r=t.data;e.form.invoice_id=r.data.invoice_id,e.form.invoice_slug=r.data.invoice_slug,o&&e.showInvoiceAndPrint()})).catch((function(){toast.fire({type:"error",title:e.$t("common.error_msg")})}));case 3:case"end":return r.stop()}}),r)})))()},addPayment:function(){var t=this;return $(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t.form.invoice_id){e.next=5;break}return e.next=3,t.form.post(window.location.origin+"/api/invoices-pay").then($(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.showModal=!1,e.next=3,t.showInvoiceAndPrint();case 3:t.form.reset(),t.againDefaultSettings();case 5:case"end":return e.stop()}}),e)})))).catch((function(){toast.fire({type:"error",title:t.$t("common.error_msg")})}));case 3:e.next=7;break;case 5:return e.next=7,toast.fire({type:"error",title:t.$t("common.error_msg")});case 7:case"end":return e.stop()}}),e)})))()},closeModalAndClearFormData:function(){this.showModal=!1,this.generateOrder=!1,this.form.reset(),this.againDefaultSettings()},closeReceiptModal:function(){this.showSmallInvoiceModal=!1,this.form.reset(),this.againDefaultSettings(),this.clickCount=0,console.log("from close"+this.clickCount)},completeOrderAndAddPayment:function(){var t=this;return $(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.saveInvoice(!1);case 2:null!=t.form.invoice_id&&(t.showModal=!0,t.form.paidAmount=t.form.netTotal.toFixed(2),t.$nextTick((function(){return t.$refs.paidAmountInput.focus()})));case 3:case"end":return e.stop()}}),e)})))()},showInvoiceAndPrint:function(){var t=this;return $(C().mark((function e(){return C().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getInvoice(t.form.invoice_slug);case 2:t.form.reset(),t.againDefaultSettings(),t.showSmallInvoiceModal=!0,setTimeout((function(){return t.printInvoice()}),500);case 6:case"end":return e.stop()}}),e)})))()},printInvoice:function(){var t=document.getElementById("invoice-POS").innerHTML,e=window.open("","","height=500, width=500");e.document.write('<link rel="stylesheet" href="/css/pos_print.css"><html>'),e.document.write("<body >"),e.document.write(t),e.document.write("</body></html>"),e.document.close(),e.print()},againDefaultSettings:function(){this.getAccounts(),this.getClients(),this.getTaxes(),this.showModal=!1,this.generateOrder=!1}}},N=(r(619),Object(_.a)(S,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{attrs:{id:"pos"}},[r("breadcrumbs",{attrs:{items:t.breadcrumbs,current:t.breadcrumbsCurrent}}),t._v(" "),r("div",{staticClass:"row sm-col-reverse"},[r("div",{staticClass:"col-12 col-md-5"},[r("div",{staticClass:"card"},[r("div",{staticClass:"card-body-l p-0"},[r("div",{staticClass:"card-client-search"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-11 col-sm-11 col-md-11 col-lg-11"},[r("v-select",{class:{"is-invalid":t.form.errors.has("client")},attrs:{options:t.clients,label:"name",name:"client",placeholder:t.$t("common.client_placeholder")},model:{value:t.form.client,callback:function(e){t.$set(t.form,"client",e)},expression:"form.client"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"client"}})],1),t._v(" "),r("div",{staticClass:"col-1 col-sm-1 col-md-1 col-lg-1 my-auto"},[r("ClientCreateModal",{on:{reloadClients:t.getClients}})],1)])]),t._v(" "),r("div",{staticClass:"table-responsive table-wrap"},[r("table",{staticClass:"table table-striped"},[r("thead",[r("tr",[r("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("common.product")))]),t._v(" "),r("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("common.price")))]),t._v(" "),r("th",{staticClass:"text-center",attrs:{scope:"col"}},[t._v("\n "+t._s(t.$t("common.quantity"))+"\n ")]),t._v(" "),r("th",{staticClass:"text-center",attrs:{scope:"col"}},[t._v("\n "+t._s(t.$t("common.subtotal"))+"\n ")]),t._v(" "),r("th",{staticClass:"text-center",attrs:{scope:"col"}},[t._v("\n "+t._s(t.$t("common.action"))+"\n ")])])]),t._v(" "),t.form.selectedProducts&&t.form.selectedProducts.length>0?r("tbody",t._l(t.form.selectedProducts,(function(e,o){return r("tr",{key:o},[r("td",[t._v(t._s(e.name))]),t._v(" "),r("td",[t._v(t._s(t._f("withCurrency")(e.unitPrice)))]),t._v(" "),r("td",[r("div",{staticClass:"d-flex custom-qty-input"},[r("input",{staticClass:"button-minus icon-shape icon-sm btn-danger",attrs:{type:"button",value:"-","data-field":"quantity"},on:{click:function(r){return t.generateItemTotal(e.qty,"qty",o,"decrement")}}}),t._v(" "),r("input",{staticClass:"quantity-field border-0 incrementor",attrs:{type:"number",step:"any",id:"Qty-"+o,name:"quantity",required:"",min:"1",max:e.inventoryCount,placeholder:"Quantity"},domProps:{value:e.qty},on:{change:function(e){return t.generateItemTotal(e.target.value,"qty",o,"")},keyup:function(e){return t.generateItemTotal(e.target.value,"qty",o,"")}}}),t._v(" "),r("input",{staticClass:"button-plus icon-shape icon-sm btn-primary",attrs:{type:"button",value:"+","data-field":"quantity"},on:{click:function(r){return t.generateItemTotal(e.qty,"qty",o,"increment")}}})])]),t._v(" "),r("td",[t._v(t._s(t._f("withCurrency")(e.totalPrice)))]),t._v(" "),r("td",{staticClass:"text-right"},[r("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(r){return t.removeItem(e)}}},[r("i",{staticClass:"fas fa-times"})])])])})),0):r("tbody",[r("tr",{staticClass:"text-center"},[r("td",{attrs:{colspan:"5"}},[t._v(t._s(t.$t("no_data_found")))])])])])])])]),t._v(" "),r("div",{staticClass:"pos-card-footer bg-white"},[r("div",[r("div",{staticClass:"row pt-3 pl-3 pr-3"},[r("div",{staticClass:"form-group col-md-6 col-lg-6"},[r("label",{attrs:{for:"discountType"}},[t._v(t._s(t.$t("common.discount_type")))]),t._v(" "),r("select",{directives:[{name:"model",rawName:"v-model",value:t.form.discountType,expression:"form.discountType"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("discountType")},attrs:{id:"discountType",step:"any",name:"discountType"},on:{change:[function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,"discountType",e.target.multiple?r:r[0])},t.calculateSum],keyup:t.calculateSum}},[r("option",{attrs:{value:"0"}},[t._v(t._s(t.$t("common.fixed")))]),t._v(" "),r("option",{attrs:{value:"1"}},[t._v(t._s(t.$t("common.percentage"))+"(%)")])]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"discountType"}})],1),t._v(" "),r("div",{staticClass:"form-group col-md-6 col-lg-6"},[r("label",{attrs:{for:"discount"}},[t._v(t._s(t.$t("common.discount"))+"\n "),1==t.form.discountType?r("span",[t._v("(%)")]):t._e()]),t._v(" "),r("div",{staticClass:"input-group"},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.discount,expression:"form.discount"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("discount")},attrs:{id:"discount",type:"number",step:"any",min:"1",max:1==t.form.discountType?100:t.form.subTotal,name:"discount",placeholder:t.$t("common.discount_placeholder")},domProps:{value:t.form.discount},on:{change:t.calculateSum,keyup:t.calculateSum,input:function(e){e.target.composing||t.$set(t.form,"discount",e.target.value)}}}),t._v(" "),1==t.form.discountType?r("div",{staticClass:"input-group-append"},[r("span",{staticClass:"input-group-text"},[t._v(t._s(t._f("withCurrency")(t.form.totalDiscount)))])]):t._e()]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"discount"}})],1),t._v(" "),r("div",{staticClass:"form-group col-md-6 col-lg-6"},[r("label",{attrs:{for:"transportCost"}},[t._v(t._s(t.$t("common.transport_cost")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.transportCost,expression:"form.transportCost"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("transportCost")},attrs:{id:"transportCost",type:"number",step:"any",min:"1",name:"transportCost",placeholder:t.$t("common.transport_cost_placeholder")},domProps:{value:t.form.transportCost},on:{change:t.calculateSum,keyup:t.calculateSum,input:function(e){e.target.composing||t.$set(t.form,"transportCost",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"transportCost"}})],1),t._v(" "),t.taxes?r("div",{staticClass:"form-group col-md-6 col-lg-6"},[r("label",{attrs:{for:"orderTax"}},[t._v(t._s(t.$t("common.invoice_tax"))+" ")]),t._v(" "),r("div",{staticClass:"input-group select-input-group"},[r("v-select",{staticClass:"w-85",class:{"is-invalid":t.form.errors.has("orderTax")},attrs:{options:t.taxes,label:"code",name:"orderTax",placeholder:t.$t("sales.common.invoice_tax_placeholder")},on:{input:t.calculateSum},model:{value:t.form.orderTax,callback:function(e){t.$set(t.form,"orderTax",e)},expression:"form.orderTax"}}),t._v(" "),r("div",{staticClass:"input-group-prepend input-c-margin"},[r("div",{staticClass:"input-group-text"},[t.form.orderTax?r("span",[t._v(t._s(t._f("withCurrency")(t.form.totalTax)))]):r("span",[t._v(t._s(t._f("withCurrency")(0)))])])])],1)]):t._e()]),t._v(" "),r("div",{staticClass:"pos-net-total noi-print"},[t._v("\n "+t._s(t.$t("common.net_total"))+": "+t._s(t._f("withCurrency")(t.form.netTotal))+"\n ")])])]),t._v(" "),r("div",{staticClass:"row no-print"},[r("div",{staticClass:"col-12 col-lg-5 mb-1"},[r("button",{staticClass:"btn btn-primary btn-block",on:{click:t.saveInvoice,keydown:function(e){return t.form.onKeydown(e)}}},[r("i",{staticClass:"fas fa-save"}),t._v(" "+t._s(t.$t("pos.complete_order"))+"\n ")])]),t._v(" "),r("div",{staticClass:"col-12 col-lg-5 mb-1"},[r("button",{staticClass:"btn btn-primary btn-block",on:{click:t.completeOrderAndAddPayment}},[r("i",{staticClass:"fas fa-credit-card"}),t._v("\n "+t._s(t.$t("pos.complete_order_and_add_payment"))+"\n ")])]),t._v(" "),r("div",{staticClass:"col-12 col-lg-2"},[r("button",{staticClass:"btn btn-secondary float-right btn-block",attrs:{type:"reset"},on:{click:function(e){return t.form.reset()}}},[r("i",{staticClass:"fas fa-power-off"}),t._v(" "+t._s(t.$t("common.reset"))+"\n ")])])])]),t._v(" "),r("div",{staticClass:"col-12 col-md-7"},[r("div",{staticClass:"card bg-transparent"},[r("div",{staticClass:"pos-r-head bg-white"},[r("div",{staticClass:"row"},[t.categories?r("div",{staticClass:"form-group col-md-6"},[r("v-select",{class:{"is-invalid":t.form.errors.has("category")},attrs:{options:t.categories,label:"name",name:"category",placeholder:t.$t("common.category_name_placeholder")},on:{input:t.getSubCategoriesByCategory},model:{value:t.form.category,callback:function(e){t.$set(t.form,"category",e)},expression:"form.category"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"category"}})],1):t._e(),t._v(" "),t.subCategories?r("div",{staticClass:"form-group col-md-6"},[r("v-select",{class:{"is-invalid":t.form.errors.has("subCategory")},attrs:{options:t.subCategories,label:"name",name:"subCategory",placeholder:t.$t("common.category_name_placeholder")},on:{input:t.getProductsBySubCategory},model:{value:t.form.subCategory,callback:function(e){t.$set(t.form,"subCategory",e)},expression:"form.subCategory"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"subCategory"}})],1):t._e(),t._v(" "),t.products?r("div",{staticClass:"col-md-12"},[r("div",{staticClass:"row"},[r("div",{staticClass:"form-group col-11 col-sm-11 col-md-11 col-lg-11"},[r("div",{},[r("search",{attrs:{isPosSearch:!0},on:{"reset-pagination":function(e){return t.resetPagination()},reload:t.reload},model:{value:t.query,callback:function(e){t.query=e},expression:"query"}})],1),t._v(" "),r("has-error",{attrs:{form:t.form,field:"selectedProducts"}})],1),t._v(" "),r("div",{staticClass:"col-1 col-sm-1 col-md-1 col-lg-1 mt-2"},[r("ProductCreateModal",{on:{reloadProducts:t.getProducts}})],1)])]):t._e()])]),t._v(" "),r("div",{staticClass:"card-body bg-white mt-3 pos-body"},[r("div",{staticClass:"pos-item-grid"},t._l(t.products,(function(e){return r("div",{key:e.id,class:Number(e.inventoryCount)<1?"pos-item-grid-red":"",on:{click:function(r){return t.storeProduct(e)}}},[r("div",{staticClass:"pos-box"},[r("div",{staticClass:"relative"},[r("div",{staticClass:"pos-box-img"},[e.image?r("div",[r("img",{staticClass:"pos-box-icon",attrs:{src:e.image,alt:"product image"}})]):r("div",[t._v(t._s(t.$t("common.no_preview")))])]),t._v(" "),r("span",{staticClass:"box-qty",class:Number(e.inventoryCount)<1?"qty-red":""},[t._v(t._s(e.inventoryCount))])]),t._v(" "),r("div",{staticClass:"pos-box-content"},[r("span",[t._v(t._s(t._f("withPrefix")(e.code,t.productPrefix)))]),t._v(" "),r("p",{staticClass:"pos-box-text"},[t._v(t._s(e.name))])])])])})),0),t._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"col-12 d-flex justify-content-center"},[t.pagination&&t.pagination.last_page>1?r("pagination",{staticClass:"justify-flex-end mt-3",attrs:{pagination:t.pagination,offset:5},on:{paginate:t.paginate}}):t._e()],1)])])])])]),t._v(" "),t.showModal?r("Modal",{staticClass:"pay-modal",attrs:{form:t.form}},[r("h5",{attrs:{slot:"header"},slot:"header"},[t._v(t._s(t.$t("pos.add_payment")))]),t._v(" "),r("div",{staticClass:"w-100",attrs:{slot:"body"},slot:"body"},[r("div",[t.accounts&&t.form.selectedProducts&&t.form.selectedProducts.length>0?r("div",{staticClass:"row"},[r("div",{staticClass:"form-group col-md-8"},[r("label",{attrs:{for:"account"}},[t._v(t._s(t.$t("common.account"))+"\n "),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("v-select",{class:{"is-invalid":t.form.errors.has("account")},attrs:{options:t.accounts,label:"label",name:"account",placeholder:t.$t("common.account_placeholder")},model:{value:t.form.account,callback:function(e){t.$set(t.form,"account",e)},expression:"form.account"}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"account"}})],1),t._v(" "),r("div",{staticClass:"form-group col-md-4"},[r("label",{attrs:{for:"paidAmount"}},[t._v(t._s(t.$t("common.amount"))),r("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.paidAmount,expression:"form.paidAmount"}],ref:"paidAmountInput",staticClass:"form-control",class:{"is-invalid":t.form.errors.has("paidAmount")},attrs:{id:"paidAmount",type:"number",step:"any",name:"paidAmount",min:"1",max:t.form.netTotal,placeholder:t.$t("common.paid_amount_placeholder")},domProps:{value:t.form.paidAmount},on:{input:function(e){e.target.composing||t.$set(t.form,"paidAmount",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"paidAmount"}})],1)]):t._e(),t._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"chequeNo"}},[t._v(t._s(t.$t("common.cheque_no")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.chequeNo,expression:"form.chequeNo"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("chequeNo")},attrs:{id:"chequeNo",type:"text",step:"any",name:"chequeNo",placeholder:t.$t("common.cheque_placeholder")},domProps:{value:t.form.chequeNo},on:{input:function(e){e.target.composing||t.$set(t.form,"chequeNo",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"chequeNo"}})],1),t._v(" "),r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"receiptNo"}},[t._v(t._s(t.$t("common.receipt_no")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.receiptNo,expression:"form.receiptNo"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("receiptNo")},attrs:{id:"receiptNo",type:"text",name:"receiptNo",placeholder:t.$t("common.receipt_no_placeholder")},domProps:{value:t.form.receiptNo},on:{input:function(e){e.target.composing||t.$set(t.form,"receiptNo",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"receiptNo"}})],1)]),t._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"poReference"}},[t._v(t._s(t.$t("common.po_reference")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.poReference,expression:"form.poReference"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("poReference")},attrs:{id:"poReference",type:"text",step:"any",name:"poReference",placeholder:t.$t("common.po_reference_placeholder")},domProps:{value:t.form.poReference},on:{input:function(e){e.target.composing||t.$set(t.form,"poReference",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"poReference"}})],1),t._v(" "),r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"paymentTerms"}},[t._v(t._s(t.$t("common.payment_terms")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.paymentTerms,expression:"form.paymentTerms"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("paymentTerms")},attrs:{id:"paymentTerms",type:"text",name:"paymentTerms",placeholder:t.$t("common.payment_terms_placeholder")},domProps:{value:t.form.paymentTerms},on:{input:function(e){e.target.composing||t.$set(t.form,"paymentTerms",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"paymentTerms"}})],1)]),t._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"reference"}},[t._v(t._s(t.$t("common.reference")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.reference,expression:"form.reference"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("reference")},attrs:{id:"reference",type:"text",name:"reference",placeholder:t.$t("common.reference_placeholder")},domProps:{value:t.form.reference},on:{input:function(e){e.target.composing||t.$set(t.form,"reference",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"reference"}})],1),t._v(" "),r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"deliveryPlace"}},[t._v(t._s(t.$t("sales.common.delivery_place")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.deliveryPlace,expression:"form.deliveryPlace"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("deliveryPlace")},attrs:{id:"deliveryPlace",type:"text",name:"deliveryPlace",placeholder:t.$t("sales.common.delivery_place_placeholder")},domProps:{value:t.form.deliveryPlace},on:{input:function(e){e.target.composing||t.$set(t.form,"deliveryPlace",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"deliveryPlace"}})],1)]),t._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"date"}},[t._v(t._s(t.$t("common.date")))]),t._v(" "),r("input",{directives:[{name:"model",rawName:"v-model",value:t.form.date,expression:"form.date"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("date")},attrs:{id:"date",type:"date",name:"date"},domProps:{value:t.form.date},on:{input:function(e){e.target.composing||t.$set(t.form,"date",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"date"}})],1),t._v(" "),r("div",{staticClass:"form-group col-md-6"},[r("label",{attrs:{for:"status"}},[t._v(t._s(t.$t("common.status")))]),t._v(" "),r("select",{directives:[{name:"model",rawName:"v-model",value:t.form.status,expression:"form.status"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("status")},attrs:{id:"status"},on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,"status",e.target.multiple?r:r[0])}}},[r("option",{attrs:{value:"1"}},[t._v(t._s(t.$t("common.active")))]),t._v(" "),r("option",{attrs:{value:"0"}},[t._v(t._s(t.$t("common.in_active")))])]),t._v(" "),r("has-error",{attrs:{form:t.form,field:"status"}})],1)]),t._v(" "),r("div",{staticClass:"form-group"},[r("label",{attrs:{for:"note"}},[t._v(t._s(t.$t("common.note")))]),t._v(" "),r("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.note,expression:"form.note"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("note")},attrs:{id:"note",placeholder:t.$t("common.note_placeholder")},domProps:{value:t.form.note},on:{input:function(e){e.target.composing||t.$set(t.form,"note",e.target.value)}}}),t._v(" "),r("has-error",{attrs:{form:t.form,field:"note"}})],1)])]),t._v(" "),r("div",{staticClass:"payment-modal-footer",attrs:{slot:"modal-footer"},slot:"modal-footer"},[r("div",{staticClass:"pos-modal-footer no-print"},[r("button",{staticClass:"btn btn-primary",on:{click:t.addPayment,keydown:function(e){return t.form.onKeydown(e)}}},[r("i",{staticClass:"fas fa-save"}),t._v(" "+t._s(t.$t("common.save"))+"\n ")]),t._v(" "),r("button",{staticClass:"modal-default-button btn btn-danger",on:{click:t.closeModalAndClearFormData}},[t._v("\n "+t._s(t.$t("common.close"))+"\n ")])])])]):t._e(),t._v(" "),t.showSmallInvoiceModal?r("Modal",{attrs:{allData:t.allData}},[r("h5",{staticClass:"no-print",attrs:{slot:"header"},slot:"header"},[t._v(t._s(t.$t("pos.invoice_receipt")))]),t._v(" "),r("div",{staticClass:"w-100",attrs:{slot:"body"},slot:"body"},[r("div",{attrs:{id:"invoice-POS"}},[r("div",{staticStyle:{"max-width":"400px",margin:"0px auto"}},[r("div",{staticClass:"info"},[t.appInfo.blackLogo?r("div",{staticClass:"pos-logo"},[r("img",{attrs:{src:t.appInfo.blackLogo,width:"100px"}})]):r("h2",{staticClass:"text-center"},[t._v(t._s(t.appInfo.companyName))]),t._v(" "),r("p",[r("span",[t._v(t._s(t.$t("common.date"))+" : "+t._s(t.allData.invoiceDate)+" "),r("br")]),t._v(" "),r("span",{directives:[{name:"show",rawName:"v-show",value:t.appInfo.address,expression:"appInfo.address"}]},[t._v(t._s(t.$t("common.address"))+" : "+t._s(t.appInfo.address)+" "),r("br")]),t._v(" "),r("span",{directives:[{name:"show",rawName:"v-show",value:t.appInfo.email,expression:"appInfo.email"}]},[t._v(t._s(t.$t("common.email"))+" : "+t._s(t.appInfo.email)+" "),r("br")]),t._v(" "),r("span",{directives:[{name:"show",rawName:"v-show",value:t.appInfo.phone,expression:"appInfo.phone"}]},[t._v(t._s(t.$t("common.phone"))+" : "+t._s(t.appInfo.phone)+" "),r("br")]),t._v(" "),r("span",{directives:[{name:"show",rawName:"v-show",value:t.allData.client.name,expression:"allData.client.name"}]},[t._v(t._s(t.$t("common.client"))+" : "+t._s(t.allData.client.name)+" "),r("br")]),t._v(" "),r("span",{directives:[{name:"show",rawName:"v-show",value:t.allData.createdBy,expression:"allData.createdBy"}]},[t._v(t._s(t.$t("common.sold_by"))+" : "+t._s(t.allData.createdBy)+" "),r("br")])])]),t._v(" "),r("table",{staticClass:"table_data"},[r("tbody",[t._l(t.invoiceProducts,(function(e,o){return r("tr",{key:o},[r("td",{attrs:{colspan:"3"}},[r("span",[t._v("\n "+t._s(e.productName)),r("br"),t._v(" "),r("span",{staticClass:"pqty"},[t._v(t._s(e.quantity)+" "+t._s(e.productUnit)+" x\n "+t._s(t._f("withCurrency")(e.unitCost)))])])]),t._v(" "),r("td",{staticStyle:{"text-align":"right","vertical-align":"bottom"}},[t._v("\n "+t._s(t._f("withCurrency")(e.unitCost*e.quantity))+"\n ")])])})),t._v(" "),r("tr",{staticStyle:{"margin-top":"10px"}},[r("td",{staticClass:"total",attrs:{colspan:"3"}},[t._v(t._s(t.$t("common.subtotal")))]),t._v(" "),r("td",{staticClass:"total",staticStyle:{"text-align":"right"}},[t._v("\n "+t._s(t._f("withCurrency")(t.allData.subTotal))+"\n ")])]),t._v(" "),t.allData.discount?r("tr",{staticStyle:{"margin-top":"10px"}},[r("td",{staticClass:"total",attrs:{colspan:"3"}},[t._v(t._s(t.$t("common.discount")))]),t._v(" "),r("td",{staticClass:"total",staticStyle:{"text-align":"right"}},[t._v("\n "+t._s(t._f("withCurrency")(t.allData.discount))+"\n ")])]):t._e(),t._v(" "),t.allData.tax?r("tr",{staticStyle:{"margin-top":"10px"}},[r("td",{staticClass:"total",attrs:{colspan:"3"}},[t._v(t._s(t.$t("common.tax"))+"(%)")]),t._v(" "),r("td",{staticClass:"total",staticStyle:{"text-align":"right"}},[t._v("\n "+t._s(t._f("withCurrency")(t.allData.tax))+"\n ")])]):t._e(),t._v(" "),r("tr",{staticStyle:{"margin-top":"10px"}},[r("td",{staticClass:"total",attrs:{colspan:"3"}},[t._v(t._s(t.$t("common.total")))]),t._v(" "),r("td",{staticClass:"total",staticStyle:{"text-align":"right"}},[t._v("\n "+t._s(t._f("withCurrency")(t.allData.subTotal-t.allData.totalInvoiceReturn-t.allData.discount+t.allData.transport+t.allData.tax))+"\n ")])]),t._v(" "),r("tr",[r("td",{staticClass:"total",attrs:{colspan:"3"}},[t._v(t._s(t.$t("common.paid")))]),t._v(" "),r("td",{staticClass:"total",staticStyle:{"text-align":"right"}},[t._v("\n "+t._s(t._f("withCurrency")(t.allData.totalPaid))+"\n ")])]),t._v(" "),r("tr",[r("td",{staticClass:"total",attrs:{colspan:"3"}},[t._v(t._s(t.$t("common.due")))]),t._v(" "),r("td",{staticClass:"total",staticStyle:{"text-align":"right"}},[t._v("\n "+t._s(t._f("withCurrency")(t.allData.due))+"\n ")])])],2)]),t._v(" "),r("div",{staticClass:"ml-2 mb-4",attrs:{id:"legalcopy"}},[r("p",{staticClass:"legal"},[r("strong",[t._v(t._s(t.$t("pos.receipt_text")))])]),t._v(" "),r("div",{attrs:{id:"bar"}},[r("barcode",{attrs:{width:"2",height:"25",fontSize:"15",value:t._f("withPrefix")(t.allData.invoiceNo,t.invoicePrefix)}},[t._v("\n "+t._s(t.$t("common.rendering_fails"))+"\n ")])],1)])])])]),t._v(" "),r("div",{staticClass:"pos-modal-footer no-print",attrs:{slot:"modal-footer"},slot:"modal-footer"},[r("div",[r("button",{staticClass:"modal-default-button btn btn-info",on:{click:function(e){return t.printInvoice()}}},[t._v("\n "+t._s(t.$t("common.print"))+"\n ")])]),t._v(" "),r("button",{staticClass:"modal-default-button btn btn-danger",on:{click:t.closeReceiptModal}},[t._v("\n "+t._s(t.$t("common.close"))+"\n ")])])]):t._e()],1)}),[],!1,null,"7b47e9c6",null));e.default=N.exports},509:function(t,e,r){var o=r(618);"string"==typeof o&&(o=[[t.i,o,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};r(39)(o,a);o.locals&&(t.exports=o.locals)},510:function(t,e,r){var o=r(620);"string"==typeof o&&(o=[[t.i,o,""]]);var a={hmr:!0,transform:void 0,insertInto:void 0};r(39)(o,a);o.locals&&(t.exports=o.locals)},512:function(t,e,r){t.exports=r.p+"21527b8a2bd935b6a7a83edec0c5ba4b.wav"},617:function(t,e,r){"use strict";r(509)},618:function(t,e,r){(t.exports=r(38)(!1)).push([t.i,".create-button[data-v-0456f1cb]{text-decoration:none;cursor:pointer}",""])},619:function(t,e,r){"use strict";r(510)},620:function(t,e,r){(t.exports=r(38)(!1)).push([t.i,".pos-r-head[data-v-7b47e9c6]{box-shadow:0 0 3px rgba(0,0,0,.2);padding:20px;box-sizing:border-box;border-radius:5px;border-bottom:1px solid #f3f3f3}.pos-logo[data-v-7b47e9c6]{text-align:center}.pos-item-grid[data-v-7b47e9c6]{display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr;grid-gap:10px}.pos-item-grid>div[data-v-7b47e9c6]{border-radius:10px;box-shadow:0 4px 20px 1px rgba(0,0,0,.06),0 1px 4px rgba(0,0,0,.08);overflow:hidden;cursor:pointer;border:1px solid #fff;position:relative}.pos-item-grid>div[data-v-7b47e9c6]:hover{border-color:#6366f1}.pos-item-grid>div .box-qty[data-v-7b47e9c6]{position:absolute;width:50px;height:30px;display:block;background:#6366f1;top:0;left:0;text-align:center;line-height:30px;font-size:12px;font-weight:700;color:#fff;border-bottom-right-radius:10px}.qty-red[data-v-7b47e9c6]{background:red!important}.pos-body[data-v-7b47e9c6]{border-radius:5px;min-height:240px}.pos-box-img[data-v-7b47e9c6]{width:100%;height:100px;border-bottom:1px solid #f1f1f1;background:#ebebeb;line-height:100px;text-align:center;font-size:13px;font-weight:700}.pos-box-img img[data-v-7b47e9c6]{width:100%;height:100px;-o-object-fit:cover;object-fit:cover}.pos-box-content p[data-v-7b47e9c6]{font-size:14px;font-weight:700;margin-bottom:0}.pos-box-content span[data-v-7b47e9c6]{font-size:12px;margin-bottom:2px}.pos-box-content[data-v-7b47e9c6]{padding:5px 10px}.pos-item-grid-red[data-v-7b47e9c6]{border-color:red!important}.card-client-search[data-v-7b47e9c6]{padding:20px;border-bottom:1px solid #ddd}.table-wrap[data-v-7b47e9c6]{padding:15px}.table-responsive.table-wrap>table[data-v-7b47e9c6]{border:1px solid #ddd}.table-wrap .table thead tr[data-v-7b47e9c6]{border-bottom:0;background:rgba(99,102,241,.1215686275)!important}.table-wrap .incrementor[data-v-7b47e9c6]{width:80px}.table-wrap .custom-qty-input[data-v-7b47e9c6]{display:inline-flex!important;justify-content:center;border:1px solid rgba(236,236,253,.7215686275);padding:0;border-radius:18px}.table-wrap .btn-danger[data-v-7b47e9c6]{width:25px;height:25px;font-size:10px;padding:0}.table-wrap .icon-sm[data-v-7b47e9c6]{width:25px;height:25px;line-height:23px}.pos-card-footer[data-v-7b47e9c6]{border:1px solid #ddd;background:#fff;border-radius:4px;margin-bottom:15px;overflow:hidden}.pos-net-total[data-v-7b47e9c6]{background:rgba(99,102,241,.2);width:100%;padding:10px;text-align:center;font-size:22px;font-weight:700}.product[data-v-7b47e9c6]{cursor:pointer}.product .info-box[data-v-7b47e9c6]:hover{background:#e0e0e0}.dark-mode .pos-body[data-v-7b47e9c6],.dark-mode .pos-r-head[data-v-7b47e9c6]{background:#111827!important;border-color:#000}.dark-mode .pos-item-grid>div[data-v-7b47e9c6]{border-color:#6c757d!important}.dark-mode .pos-box-content[data-v-7b47e9c6]{padding:5px 10px;color:#fff}.dark-mode .pos-item-grid>div.pos-item-grid-red[data-v-7b47e9c6]{border-color:red!important}.dark-mode .card-client-search[data-v-7b47e9c6]{border-color:#6c757d}.dark-mode .table-striped tbody tr[data-v-7b47e9c6]:nth-of-type(odd){background-color:#1f2937}.dark-mode .table-responsive.table-wrap>table[data-v-7b47e9c6]{border:1px solid #6c757d}.dark-mode .table-wrap .incrementor[data-v-7b47e9c6]{border:none!important}.dark-mode .pos-card-footer.bg-white[data-v-7b47e9c6]{background:#111827!important;border-color:#6c757d}.dark-mode .pos-card-footer label[data-v-7b47e9c6]{color:#fff}.dark-mode .pos-net-total[data-v-7b47e9c6]{background:#63a9f1;color:#fff}#invoice-POS table[data-v-7b47e9c6],#invoice-POS td[data-v-7b47e9c6],#invoice-POS th[data-v-7b47e9c6],#invoice-POS tr[data-v-7b47e9c6]{border-collapse:collapse}#invoice-POS tr[data-v-7b47e9c6]{border-bottom:2px dotted #05070b}#invoice-POS table[data-v-7b47e9c6]{width:100%}#invoice-POS tfoot tr th[data-v-7b47e9c6]:first-child{text-align:left}#invoice-POS .info[data-v-7b47e9c6]{margin-bottom:20px}#invoice-POS .info>p[data-v-7b47e9c6]{margin-top:20px}#legalcopy[data-v-7b47e9c6]{margin-top:5mm}#bar[data-v-7b47e9c6],#legalcopy p[data-v-7b47e9c6]{text-align:center}.total[data-v-7b47e9c6]{font-weight:700;font-size:12px}span.pqty[data-v-7b47e9c6]{display:block;line-height:15px;font-size:12px;font-weight:500;margin-bottom:5px}@media only screen and (max-width:1250px){.pos-item-grid[data-v-7b47e9c6]{grid-template-columns:1fr 1fr 1fr 1fr}}@media only screen and (max-width:991px){.pos-item-grid[data-v-7b47e9c6]{grid-template-columns:1fr 1fr 1fr}}@media only screen and (max-width:767px){.sm-col-reverse[data-v-7b47e9c6]{flex-direction:column-reverse}.pos-item-grid[data-v-7b47e9c6]{grid-template-columns:1fr 1fr 1fr 1fr}}.create-client-button[data-v-7b47e9c6]{text-decoration:none;cursor:pointer}",""])}}]);
Simpan