⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
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
/
View File Name :
140.a24c36.js
/*! For license information please see 140.a24c36.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[140],{524:function(t,e,r){"use strict";r.r(e);var o=r(4),a=r(5),n=r(3),s=r.n(n);function i(t){return(i="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",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function m(t,e,r,a){var n=e&&e.prototype instanceof v?e:v,s=Object.create(n.prototype),i=new N(a||[]);return o(s,"_invoke",{value:P(t,r,i)}),s}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=m;var f={};function v(){}function p(){}function h(){}var y={};u(y,n,(function(){return this}));var _=Object.getPrototypeOf,g=_&&_(_(I([])));g&&g!==e&&r.call(g,n)&&(y=g);var b=h.prototype=v.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){var a;o(this,"_invoke",{value:function(o,n){function s(){return new e((function(a,s){!function o(a,n,s,c){var l=d(t[a],t,n);if("throw"!==l.type){var u=l.arg,m=u.value;return m&&"object"==i(m)&&r.call(m,"__await")?e.resolve(m.__await).then((function(t){o("next",t,s,c)}),(function(t){o("throw",t,s,c)})):e.resolve(m).then((function(t){u.value=t,s(u)}),(function(t){return o("throw",t,s,c)}))}c(l.arg)}(o,n,a,s)}))}return a=a?a.then(s,s):s()}})}function P(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 R()}for(r.method=a,r.arg=n;;){var s=r.delegate;if(s){var i=w(s,r);if(i){if(i===f)continue;return i}}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=d(t,e,r);if("normal"===c.type){if(o=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o="completed",r.method="throw",r.arg=c.arg)}}}function w(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,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=d(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,f;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,f):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(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 $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(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:R}}function R(){return{value:void 0,done:!0}}return p.prototype=h,o(b,"constructor",{value:h,configurable:!0}),o(h,"constructor",{value:p,configurable:!0}),p.displayName=u(h,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,u(t,l,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(T.prototype),u(T.prototype,s,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,o,a,n){void 0===n&&(n=Promise);var s=new T(m(e,r,o,a),n);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(b),u(b,l,"Generator"),u(b,n,(function(){return this})),u(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=I,N.prototype={constructor:N,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($),!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 s.type="throw",s.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],s=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var i=r.call(n,"catchLoc"),c=r.call(n,"finallyLoc");if(i&&c){if(this.prev<n.catchLoc)return o(n.catchLoc,!0);if(this.prev<n.finallyLoc)return o(n.finallyLoc)}else if(i){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 s=n?n.completion:{};return s.type=t,s.arg=e,n?(this.method="next",this.next=n.finallyLoc,f):this.complete(s)},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),f},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),$(r),f}},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;$(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function l(t,e,r,o,a,n,s){try{var i=t[n](s),c=i.value}catch(t){return void r(t)}i.done?e(c):Promise.resolve(c).then(o,a)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var n=t.apply(e,r);function s(t){l(n,o,a,s,i,"next",t)}function i(t){l(n,o,a,s,i,"throw",t)}s(void 0)}))}}function m(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 d(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===i(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var f={middleware:["auth","check-permissions"],metaInfo:function(){return{title:this.$t("sales.invoices.edit.page_title")}},data:function(){return{breadcrumbsCurrent:"sales.invoices.edit.breadcrumbs_current",breadcrumbs:[{name:"sales.invoices.edit.breadcrumbs_first",url:"home"},{name:"sales.invoices.edit.breadcrumbs_second",url:"invoices.index"},{name:"sales.invoices.edit.breadcrumbs_active",url:""}],form:new a.a({invoiceNo:"",client:"",reference:"",selectedProducts:[],subTotal:0,netTotal:0,discountType:0,discount:"",discountPercentage:"",totalDiscount:"",transportCost:"",orderTax:"",totalTax:0,account:"",totalPaid:"",dueAmount:"",clientAdvance:0,poReference:"",paymentTerms:"",deliveryPlace:"",totalInvoiceReturn:0,note:"",date:"",status:1}),products:"",accounts:"",taxes:"",prefix:""}},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){d(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(o.b)("operations",["items","appInfo"])),created:function(){this.getClients(),this.getTaxes(),this.getProducts(),this.getInvoice(),this.prefix=this.appInfo.productPrefix},methods:{getClients:function(){var t=this;return u(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("operations/allData",{path:"/api/all-clients"});case 2:case"end":return e.stop()}}),e)})))()},getTaxes:function(){var t=this;return u(c().mark((function e(){var r,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.a.get(window.location.origin+"/api/all-vat-rates");case 2:r=e.sent,o=r.data,t.taxes=o.data;case 5:case"end":return e.stop()}}),e)})))()},getProducts:function(){var t=this;return u(c().mark((function e(){var r,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.a.get(window.location.origin+"/api/all-products");case 2:r=e.sent,o=r.data,t.products=o.data,t.products.sort(t.sortProducts);case 6: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},getInvoice:function(){var t=this;return u(c().mark((function e(){var r,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.a.get(window.location.origin+"/api/invoices/"+t.$route.params.slug);case 2:r=e.sent,o=r.data,t.form.invoiceNo=o.data.invoiceNo,t.form.client=o.data.client,t.form.reference=o.data.reference,t.form.poReference=o.data.poReference,t.form.paymentTerms=o.data.paymentTerms,t.form.deliveryPlace=o.data.deliveryPlace,t.form.date=o.data.invoiceDate,t.form.note=o.data.note,t.form.status=o.data.status,t.form.transportCost=o.data.transport,t.form.totalDiscount=o.data.discount,t.form.discount=0==o.data.discountType?o.data.discount:o.data.discountPercentage,t.form.discountPercentage=o.data.discountPercentage,t.form.discountType=o.data.discountType,t.form.totalTax=o.data.tax,t.form.orderTax=o.data.taxRate,t.form.netTotal=Number(o.data.invoiceTotal),t.form.subTotal=Number(o.data.subTotal),t.form.totalPaid=Number(o.data.totalPaid),t.form.dueAmount=Number(o.data.due),t.form.totalInvoiceReturn=Number(o.data.totalInvoiceReturn),t.form.selectedProducts=t.assignProducts(o.data.invoiceProducts);case 26:case"end":return e.stop()}}),e)})))()},storeProduct:function(t){var e=this.form.selectedProducts.findIndex((function(e){return e.id==t.id}));if(-1===e){var r="Exclusive"==t.taxType?t.priceWithDiscount*(t.taxRate/100):t.priceWithDiscount-t.priceWithDiscount/(1+t.taxRate/100),o=1*r;this.form.selectedProducts.unshift({id:t.id,slug:t.slug,name:t.name,code:t.code,taxType:t.taxType,taxRate:t.taxRate,qty:1,oldQty:0,inventoryCount:t.inventoryCount,avgPurchasePrice:t.avgPurchasePrice,unitPrice:t.priceWithDiscount,unitCost:"Exclusive"==t.taxType?t.priceWithDiscount+r:t.priceWithDiscount,totalPrice:"Exclusive"==t.taxType?1*(t.priceWithDiscount+o):1*t.priceWithDiscount,productTax:t.productTax>0?t.productTax:0,totalTax:o,minQty:1})}this.generateItemTotal(1,"qty",e,"")},generateItemTotal:function(t,e,r,o){var a=this.form.selectedProducts[r];a&&("qty"==e?(a.qty=t,"increment"==o?a.qty=Number(a.qty)+1:"decrement"==o&&a.qty>0&&(a.qty=Number(a.qty)-1)):(a.unitPrice=t,"increment"==o?a.unitPrice=Number(a.unitPrice)+1:"decrement"==o&&a.unitPrice>0&&(a.unitPrice=Number(a.unitPrice)-1)),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}var e=Number(this.form.totalPaid);e<=this.form.netTotal?(this.form.dueAmount=(this.form.netTotal-e).toFixed(2),this.form.clientAdvance=0):(this.form.clientAdvance=e-this.form.netTotal,this.form.dueAmount=0)},assignProducts:function(t){for(var e in this.form.selectedProducts=[],t){var r=t[e];this.form.selectedProducts.unshift({id:r.productID,slug:r.productSlug,name:r.productName,code:r.productCode,taxType:r.taxType,taxRate:r.taxRate,oldQty:r.quantity,qty:r.quantity,returnQty:r.returnQty,inventoryCount:r.inventoryCount,avgPurchasePrice:r.purchasePrice,unitPrice:r.salePrice,unitCost:r.unitCost,totalPrice:r.unitCostTotal,productTax:r.unitTax,totalTax:r.taxTotal,minQty:r.returnQty})}return this.calculateSum(),this.form.selectedProducts},updateInvoice:function(){var t=this;return u(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.patch(window.location.origin+"/api/invoices/"+t.$route.params.slug).then((function(e){var r=e.data;toast.fire({type:"success",title:t.$t("sales.invoices.edit.success_msg")}),t.$router.push({name:"invoices.show",params:{slug:r.data.slug}})})).catch((function(){toast.fire({type:"error",title:t.$t("common.error_msg")})}));case 2:case"end":return e.stop()}}),e)})))()}}},v=r(1),p=Object(v.a)(f,(function(){var t=this,e=t._self._c;return e("div",[e("breadcrumbs",{attrs:{items:t.breadcrumbs,current:t.breadcrumbsCurrent}}),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"col-lg-12 col-xl-12"},[e("div",{staticClass:"card"},[e("div",{staticClass:"card-header"},[e("h3",{staticClass:"card-title"},[t._v("\n "+t._s(t.$t("sales.invoices.edit.form_title"))+"\n ")]),t._v(" "),e("router-link",{staticClass:"btn btn-dark float-right",attrs:{to:{name:"invoices.index"}}},[e("i",{staticClass:"fas fa-long-arrow-alt-left"}),t._v(" "+t._s(t.$t("common.back"))+"\n ")])],1),t._v(" "),e("form",{attrs:{role:"form"},on:{submit:function(e){return e.preventDefault(),t.updateInvoice.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("div",{staticClass:"card-body"},[t.items?e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"client"}},[t._v(t._s(t.$t("common.client"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("v-select",{class:{"is-invalid":t.form.errors.has("client")},attrs:{options:t.items,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(" "),e("has-error",{attrs:{form:t.form,field:"client"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"reference"}},[t._v(t._s(t.$t("common.reference")))]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"reference"}})],1)]):t._e(),t._v(" "),t.products?e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-12"},[e("label",{attrs:{for:"product"}},[t._v(t._s(t.$t("common.select_products"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("v-select",{class:{"is-invalid":t.form.errors.has("selectedProducts")},attrs:{options:t.products,label:"label",name:"product",placeholder:t.$t("common.select_products_placeholder")},on:{input:function(e){return t.storeProduct(t.form.product)}},model:{value:t.form.product,callback:function(e){t.$set(t.form,"product",e)},expression:"form.product"}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"selectedProducts"}})],1)]):t._e(),t._v(" "),t.form.selectedProducts&&t.form.selectedProducts.length>0?e("div",{staticClass:"row mt-3 mb-4"},[e("div",{staticClass:"table-responsive table-custom w-95 m-auto"},[e("table",{staticClass:"table table-hover table-sm text-center"},[e("thead",[e("tr",[e("th",[t._v(t._s(t.$t("common.s_no")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.code")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.product_name")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.invoice_qty")))]),t._v(" "),t.form.totalInvoiceReturn>0?e("th",[t._v("\n "+t._s(t.$t("common.return_qty"))+"\n ")]):t._e(),t._v(" "),e("th",[t._v(t._s(t.$t("common.price")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.unit_price")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.tax")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.subtotal")))]),t._v(" "),e("th",{staticClass:"text-right"},[t._v(t._s(t.$t("common.action")))])])]),t._v(" "),e("tbody",[t._l(t.form.selectedProducts,(function(r,o){return e("tr",{key:o},[e("td",[t._v(t._s(++o))]),t._v(" "),e("td",[t._v(t._s(t._f("withPrefix")(r.code,t.prefix)))]),t._v(" "),e("td",[t.$can("product-view")?e("router-link",{attrs:{to:{name:"products.show",params:{slug:r.slug}}}},[t._v("\n "+t._s(r.name)+"\n ")]):e("span",[t._v(t._s(r.name))])],1),t._v(" "),e("td",[e("div",{staticClass:"input-group custom-qty-input"},[e("input",{staticClass:"button-minus icon-shape icon-sm btn-danger",attrs:{type:"button",value:"-","data-field":"quantity"},on:{click:function(e){return t.generateItemTotal(r.qty,"qty",o-1,"decrement")}}}),t._v(" "),e("input",{staticClass:"quantity-field border-0 incrementor",attrs:{type:"number",step:"any",id:"Qty-".concat(o),name:"quantity",required:"",min:r.minQty,max:Number(r.inventoryCount)+Number(r.oldQty),placeholder:"Quantity"},domProps:{value:r.qty},on:{change:function(e){return t.generateItemTotal(e.target.value,"qty",o-1,"")},keyup:function(e){return t.generateItemTotal(e.target.value,"qty",o-1,"")}}}),t._v(" "),e("input",{staticClass:"button-plus icon-shape icon-sm btn-primary",attrs:{type:"button",value:"+","data-field":"quantity"},on:{click:function(e){return t.generateItemTotal(r.qty,"qty",o-1,"increment")}}})])]),t._v(" "),t.form.totalInvoiceReturn>0?e("td",[t._v("\n "+t._s(r.returnQty)+"\n ")]):t._e(),t._v(" "),e("td",{staticClass:"text-center"},[e("div",{staticClass:"input-group custom-qty-input"},[e("input",{staticClass:"button-minus icon-shape icon-sm btn-danger",attrs:{type:"button",value:"-","data-field":"unitPrice"},on:{click:function(e){return t.generateItemTotal(r.unitPrice,"price",o-1,"decrement")}}}),t._v(" "),e("input",{staticClass:"quantity-field border-0 incrementor",attrs:{type:"number",step:"any",id:"unitPrice-".concat(o),name:"unitPrice",required:"",min:"1"},domProps:{value:r.unitPrice},on:{change:function(e){return t.generateItemTotal(e.target.value,"price",o-1,"")},keyup:function(e){return t.generateItemTotal(e.target.value,"price",o-1,"")}}}),t._v(" "),e("input",{staticClass:"button-plus icon-shape icon-sm btn-primary",attrs:{type:"button",value:"+","data-field":"unitPrice"},on:{click:function(e){return t.generateItemTotal(r.unitPrice,"price",o-1,"increment")}}})])]),t._v(" "),e("td",[t._v(t._s(t._f("withCurrency")(r.unitCost)))]),t._v(" "),e("td",[t._v(t._s(t._f("withCurrency")(r.totalTax)))]),t._v(" "),e("td",[t._v(t._s(t._f("withCurrency")(r.totalPrice)))]),t._v(" "),e("td",{staticClass:"text-right"},[e("button",{staticClass:"btn btn-danger",attrs:{type:"button"},on:{click:function(e){return t.removeItem(r)}}},[e("i",{staticClass:"fas fa-times"})])])])})),t._v(" "),t.form.subTotal?e("tr",[e("td",{staticClass:"text-right",attrs:{colspan:t.form.totalInvoiceReturn>0?7:6}},[e("strong",[t._v(t._s(t.$t("common.subtotal")))])]),t._v(" "),e("td",[e("strong",[t._v(t._s(t._f("withCurrency")(t.form.productTotalTax)))])]),t._v(" "),e("td",[e("strong",[t._v(t._s(t._f("withCurrency")(t.form.subTotal)))])]),t._v(" "),e("td")]):t._e()],2)])])]):t._e(),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"discountType"}},[t._v(t._s(t.$t("common.discount_type")))]),t._v(" "),e("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}},[e("option",{attrs:{value:"0"}},[t._v(t._s(t.$t("common.fixed")))]),t._v(" "),e("option",{attrs:{value:"1"}},[t._v(t._s(t.$t("common.percentage"))+"(%)")])]),t._v(" "),e("has-error",{attrs:{form:t.form,field:"discountType"}})],1),t._v(" "),e("div",{staticClass:"form-group",class:1==t.form.discountType?"col-md-2":"col-md-4"},[e("label",{attrs:{for:"discount"}},[t._v(t._s(t.$t("common.discount"))+"\n "),1==t.form.discountType?e("span",[t._v("(%)")]):t._e()]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"discount"}})],1),t._v(" "),1==t.form.discountType?e("div",{staticClass:"form-group col-md-2"},[e("label",{attrs:{for:"totalDiscount"}},[t._v(t._s(t.$t("common.total_discount")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.totalDiscount,expression:"form.totalDiscount"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("totalDiscount")},attrs:{id:"totalDiscount",type:"number",step:"any",name:"totalDiscount",readonly:""},domProps:{value:t.form.totalDiscount},on:{input:function(e){e.target.composing||t.$set(t.form,"totalDiscount",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"totalDiscount"}})],1):t._e(),t._v(" "),e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"transportCost"}},[t._v(t._s(t.$t("common.transport_cost")))]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"transportCost"}})],1)]),t._v(" "),e("div",{staticClass:"row"},[t.taxes?e("div",{staticClass:"form-group col-md-6",class:t.form.totalInvoiceReturn?"col-lg-3":"col-lg-4"},[e("label",{attrs:{for:"orderTax"}},[t._v(t._s(t.$t("common.invoice_tax"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("v-select",{class:{"is-invalid":t.form.errors.has("orderTax")},attrs:{options:t.taxes,label:"code",name:"orderTax",placeholder:t.$t("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(" "),e("has-error",{attrs:{form:t.form,field:"orderTax"}})],1):t._e(),t._v(" "),t.taxes?e("div",{staticClass:"form-group col-md-6",class:t.form.totalInvoiceReturn?"col-lg-3":"col-lg-4"},[e("label",{attrs:{for:"totalTax"}},[t._v(t._s(t.$t("common.total_tax")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.totalTax,expression:"form.totalTax"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("totalTax")},attrs:{id:"totalTax",type:"text",name:"totalTax",readonly:""},domProps:{value:t.form.totalTax},on:{input:function(e){e.target.composing||t.$set(t.form,"totalTax",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"totalTax"}})],1):t._e(),t._v(" "),t.form.totalInvoiceReturn?e("div",{staticClass:"form-group col-md-6",class:t.form.totalInvoiceReturn?"col-lg-3":"col-lg-4"},[e("label",{attrs:{for:"totalInvoiceReturn"}},[t._v(t._s(t.$t("common.return_cost")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.totalInvoiceReturn,expression:"form.totalInvoiceReturn"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("purchaseReturn")},attrs:{id:"totalInvoiceReturn",type:"number",step:"any",name:"totalInvoiceReturn",readonly:""},domProps:{value:t.form.totalInvoiceReturn},on:{input:function(e){e.target.composing||t.$set(t.form,"totalInvoiceReturn",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"purchaseReturn"}})],1):t._e(),t._v(" "),e("div",{staticClass:"form-group col-md-6",class:t.form.totalInvoiceReturn?"col-lg-3":"col-lg-4"},[e("label",{attrs:{for:"netTotal"}},[t._v(t._s(t.$t("common.net_total")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.netTotal,expression:"form.netTotal"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("netTotal")},attrs:{id:"netTotal",type:"text",name:"netTotal",readonly:""},domProps:{value:t.form.netTotal},on:{input:function(e){e.target.composing||t.$set(t.form,"netTotal",e.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"netTotal"}})],1)]),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"poReference"}},[t._v(t._s(t.$t("common.po_reference")))]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"poReference"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"paymentTerms"}},[t._v(t._s(t.$t("common.payment_terms")))]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"paymentTerms"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"deliveryPlace"}},[t._v(t._s(t.$t("sales.common.delivery_place")))]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"deliveryPlace"}})],1)]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{attrs:{for:"note"}},[t._v(t._s(t.$t("common.note")))]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"note"}})],1),t._v(" "),e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"date"}},[t._v(t._s(t.$t("common.date")))]),t._v(" "),e("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(" "),e("has-error",{attrs:{form:t.form,field:"date"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"status"}},[t._v(t._s(t.$t("common.status")))]),t._v(" "),e("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])}}},[e("option",{attrs:{value:"1"}},[t._v(t._s(t.$t("common.active")))]),t._v(" "),e("option",{attrs:{value:"0"}},[t._v(t._s(t.$t("common.in_active")))])]),t._v(" "),e("has-error",{attrs:{form:t.form,field:"status"}})],1)])]),t._v(" "),e("div",{staticClass:"card-footer"},[e("v-button",{staticClass:"btn btn-primary",attrs:{loading:t.form.busy}},[e("i",{staticClass:"fas fa-edit"}),t._v(" "+t._s(t.$t("common.save_changes"))+"\n ")]),t._v(" "),e("button",{staticClass:"btn btn-secondary float-right",attrs:{type:"reset"},on:{click:function(e){return t.form.reset()}}},[e("i",{staticClass:"fas fa-power-off"}),t._v(" "+t._s(t.$t("common.reset"))+"\n ")])],1)])])])])],1)}),[],!1,null,"71892528",null);e.default=p.exports}}]);