⚝
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
/
makarnacimmix.xyz
/
public
/
dist
/
js
/
View File Name :
112.478883.js
/*! For license information please see 112.478883.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[112],{4:function(t,r,e){"use strict";var o=e(7),s=e.n(o),a=Object.defineProperty,n=Object.prototype.hasOwnProperty,i=Object.getOwnPropertySymbols,c=Object.prototype.propertyIsEnumerable,u=(t,r,e)=>r in t?a(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,l=(t,r)=>{for(var e in r||(r={}))n.call(r,e)&&u(t,e,r[e]);if(i)for(var e of i(r))c.call(r,e)&&u(t,e,r[e]);return t};const m=t=>void 0===t,p=t=>Array.isArray(t),f=t=>t&&"number"==typeof t.size&&"string"==typeof t.type&&"function"==typeof t.slice,h=(t,r,e,o)=>((r=r||{}).indices=!m(r.indices)&&r.indices,r.nullsAsUndefineds=!m(r.nullsAsUndefineds)&&r.nullsAsUndefineds,r.booleansAsIntegers=!m(r.booleansAsIntegers)&&r.booleansAsIntegers,r.allowEmptyArrays=!m(r.allowEmptyArrays)&&r.allowEmptyArrays,e=e||new FormData,m(t)||(null===t?r.nullsAsUndefineds||e.append(o,""):(t=>"boolean"==typeof t)(t)?r.booleansAsIntegers?e.append(o,t?1:0):e.append(o,t):p(t)?t.length?t.forEach((t,s)=>{const a=o+"["+(r.indices?s:"")+"]";h(t,r,e,a)}):r.allowEmptyArrays&&e.append(o+"[]",""):(t=>t instanceof Date)(t)?e.append(o,t.toISOString()):!(t=>t===Object(t))(t)||(t=>f(t)&&"string"==typeof t.name&&("object"==typeof t.lastModifiedDate||"number"==typeof t.lastModified))(t)||f(t)?e.append(o,t):Object.keys(t).forEach(s=>{const a=t[s];if(p(a))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);h(a,r,e,o?o+"["+s+"]":s)})),e);var d={serialize:h};function v(t){if(null===t||"object"!=typeof t)return t;const r=Array.isArray(t)?[]:{};return Object.keys(t).forEach(e=>{r[e]=v(t[e])}),r}function y(t){return Array.isArray(t)?t:[t]}class _{constructor(){this.errors={},this.errors={}}set(t,r){"object"==typeof t?this.errors=t:this.set(l(l({},this.errors),{[t]:y(r)}))}all(){return this.errors}has(t){return Object.prototype.hasOwnProperty.call(this.errors,t)}hasAny(...t){return t.some(t=>this.has(t))}any(){return Object.keys(this.errors).length>0}get(t){if(this.has(t))return this.getAll(t)[0]}getAll(t){return y(this.errors[t]||[])}only(...t){const r=[];return t.forEach(t=>{const e=this.get(t);e&&r.push(e)}),r}flatten(){return Object.values(this.errors).reduce((t,r)=>t.concat(r),[])}clear(t){const r={};t&&Object.keys(this.errors).forEach(e=>{e!==t&&(r[e]=this.errors[e])}),this.set(r)}}class g{constructor(t={}){this.originalData={},this.busy=!1,this.successful=!1,this.recentlySuccessful=!1,this.recentlySuccessfulTimeoutId=void 0,this.errors=new _,this.progress=void 0,this.update(t)}static make(t){return new this(t)}update(t){this.originalData=Object.assign({},this.originalData,v(t)),Object.assign(this,t)}fill(t={}){this.keys().forEach(r=>{this[r]=t[r]})}data(){return this.keys().reduce((t,r)=>l(l({},t),{[r]:this[r]}),{})}keys(){return Object.keys(this).filter(t=>!g.ignore.includes(t))}startProcessing(){this.errors.clear(),this.busy=!0,this.successful=!1,this.progress=void 0,this.recentlySuccessful=!1,clearTimeout(this.recentlySuccessfulTimeoutId)}finishProcessing(){this.busy=!1,this.successful=!0,this.progress=void 0,this.recentlySuccessful=!0,this.recentlySuccessfulTimeoutId=setTimeout(()=>{this.recentlySuccessful=!1},g.recentlySuccessfulTimeout)}clear(){this.errors.clear(),this.successful=!1,this.recentlySuccessful=!1,this.progress=void 0,clearTimeout(this.recentlySuccessfulTimeoutId)}reset(){Object.keys(this).filter(t=>!g.ignore.includes(t)).forEach(t=>{this[t]=v(this.originalData[t])})}get(t,r={}){return this.submit("get",t,r)}post(t,r={}){return this.submit("post",t,r)}patch(t,r={}){return this.submit("patch",t,r)}put(t,r={}){return this.submit("put",t,r)}delete(t,r={}){return this.submit("delete",t,r)}submit(t,r,e={}){return this.startProcessing(),e=l({data:{},params:{},url:this.route(r),method:t,onUploadProgress:this.handleUploadProgress.bind(this)},e),"get"===t.toLowerCase()?e.params=l(l({},this.data()),e.params):(e.data=l(l({},this.data()),e.data),function t(r){return r instanceof File||r instanceof Blob||r instanceof FileList||"object"==typeof r&&null!==r&&void 0!==Object.values(r).find(r=>t(r))}(e.data)&&!e.transformRequest&&(e.transformRequest=[t=>d.serialize(t)])),new Promise((t,r)=>{(g.axios||s.a).request(e).then(r=>{this.finishProcessing(),t(r)}).catch(t=>{this.handleErrors(t),r(t)})})}handleErrors(t){this.busy=!1,this.progress=void 0,t.response&&this.errors.set(this.extractErrors(t.response))}extractErrors(t){return t.data&&"object"==typeof t.data?t.data.errors?l({},t.data.errors):t.data.message?{error:t.data.message}:l({},t.data):{error:g.errorMessage}}handleUploadProgress(t){this.progress={total:t.total,loaded:t.loaded,percentage:Math.round(100*t.loaded/t.total)}}route(t,r={}){let e=t;return Object.prototype.hasOwnProperty.call(g.routes,t)&&(e=decodeURI(g.routes[t])),"object"!=typeof r&&(r={id:r}),Object.keys(r).forEach(t=>{e=e.replace(`{${t}}`,r[t])}),e}onKeydown(t){const r=t.target;r.name&&this.errors.clear(r.name)}}g.routes={},g.errorMessage="Something went wrong. Please try again.",g.recentlySuccessfulTimeout=2e3,g.ignore=["busy","successful","errors","progress","originalData","recentlySuccessful","recentlySuccessfulTimeoutId"],r.a=g},441:function(t,r,e){"use strict";e.r(r);var o=e(4),s=e(7),a=e.n(s),n=e(3);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={},r=Object.prototype,e=r.hasOwnProperty,o=Object.defineProperty||function(t,r,e){t[r]=e.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",n=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function m(t,r,e,s){var a=r&&r.prototype instanceof h?r:h,n=Object.create(a.prototype),i=new O(s||[]);return o(n,"_invoke",{value:P(t,e,i)}),n}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=m;var f={};function h(){}function d(){}function v(){}var y={};l(y,a,(function(){return this}));var _=Object.getPrototypeOf,g=_&&_(_(N([])));g&&g!==r&&e.call(g,a)&&(y=g);var b=v.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function x(t,r){var s;o(this,"_invoke",{value:function(o,a){function n(){return new r((function(s,n){!function o(s,a,n,c){var u=p(t[s],t,a);if("throw"!==u.type){var l=u.arg,m=l.value;return m&&"object"==i(m)&&e.call(m,"__await")?r.resolve(m.__await).then((function(t){o("next",t,n,c)}),(function(t){o("throw",t,n,c)})):r.resolve(m).then((function(t){l.value=t,n(l)}),(function(t){return o("throw",t,n,c)}))}c(u.arg)}(o,a,s,n)}))}return s=s?s.then(n,n):n()}})}function P(t,r,e){var o="suspendedStart";return function(s,a){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===s)throw a;return j()}for(e.method=s,e.arg=a;;){var n=e.delegate;if(n){var i=T(n,e);if(i){if(i===f)continue;return i}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===o)throw o="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);o="executing";var c=p(t,r,e);if("normal"===c.type){if(o=e.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(o="completed",e.method="throw",e.arg=c.arg)}}}function T(t,r){var e=r.method,o=t.iterator[e];if(void 0===o)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,T(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),f;var s=p(o,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,f;var a=s.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function C(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function $(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function N(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,s=function r(){for(;++o<t.length;)if(e.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=void 0,r.done=!0,r};return s.next=s}}return{next:j}}function j(){return{value:void 0,done:!0}}return d.prototype=v,o(b,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=l(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===d||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(x.prototype),l(x.prototype,n,(function(){return this})),t.AsyncIterator=x,t.async=function(r,e,o,s,a){void 0===a&&(a=Promise);var n=new x(m(r,e,o,s),a);return t.isGeneratorFunction(e)?n:n.next().then((function(t){return t.done?t.value:n.next()}))},w(b),l(b,u,"Generator"),l(b,a,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var r=Object(t),e=[];for(var o in r)e.push(o);return e.reverse(),function t(){for(;e.length;){var o=e.pop();if(o in r)return t.value=o,t.done=!1,t}return t.done=!0,t}},t.values=N,O.prototype={constructor:O,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 r in this)"t"===r.charAt(0)&&e.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function o(e,o){return n.type="throw",n.arg=t,r.next=e,o&&(r.method="next",r.arg=void 0),!!o}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],n=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var i=e.call(a,"catchLoc"),c=e.call(a,"finallyLoc");if(i&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(i){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o];if(s.tryLoc<=this.prev&&e.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var a=s;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var n=a?a.completion:{};return n.type=t,n.arg=r,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(n)},complete:function(t,r){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&&r&&(this.next=r),f},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),$(e),f}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var o=e.completion;if("throw"===o.type){var s=o.arg;$(e)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:N(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),f}},t}function u(t,r,e,o,s,a,n){try{var i=t[a](n),c=i.value}catch(t){return void e(t)}i.done?r(c):Promise.resolve(c).then(o,s)}function l(t){return function(){var r=this,e=arguments;return new Promise((function(o,s){var a=t.apply(r,e);function n(t){u(a,o,s,n,i,"next",t)}function i(t){u(a,o,s,n,i,"throw",t)}n(void 0)}))}}function m(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,o)}return e}function p(t,r,e){return(r=function(t){var r=function(t,r){if("object"!==i(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,r||"default");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===i(r)?r:String(r)}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var f={middleware:["auth","check-permissions"],metaInfo:function(){return{title:this.$t("purchases.returns.create.page_title")}},data:function(){return{breadcrumbsCurrent:"purchases.returns.create.breadcrumbs_current",breadcrumbs:[{name:"purchases.returns.create.breadcrumbs_first",url:"home"},{name:"purchases.returns.create.breadcrumbs_second",url:"purchaseReturns.index"},{name:"purchases.returns.create.breadcrumbs_active",url:""}],form:new o.a({returnReason:"",account:"",chequeNo:"",receiptNo:"",supplier:"",purchase:"",product:"",selectedProducts:[],totalReturn:0,date:(new Date).toISOString().slice(0,10),note:"",status:1,purchaseTotal:0,newSubTotal:0,purchaseTax:0,purchaseTransport:0,purchaseDiscount:0,newTax:0,taxRate:0,purchaseDue:0,newDue:0,newDueText:"",returnAmount:0,returnAmountText:0}),products:"",accounts:"",supplierPurchases:""}},computed:function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?m(Object(e),!0).forEach((function(r){p(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):m(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}({},Object(n.b)("operations",["items","appInfo"])),created:function(){this.getSuppliers(),this.getProducts(),this.getAccounts(),this.prefix=this.appInfo.productPrefix},methods:{getSuppliers:function(){var t=this;return l(c().mark((function r(){return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$store.dispatch("operations/allData",{path:"/api/all-suppliers"});case 2:case"end":return r.stop()}}),r)})))()},getProducts:function(){var t=this;return l(c().mark((function r(){var e,o;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.form.get(window.location.origin+"/api/all-products");case 2:e=r.sent,o=e.data,t.products=o.data;case 5:case"end":return r.stop()}}),r)})))()},getAccounts:function(){var t=this;return l(c().mark((function r(){var e,o;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.form.get(window.location.origin+"/api/all-accounts");case 2:e=r.sent,o=e.data,t.accounts=o.data;case 5:case"end":return r.stop()}}),r)})))()},assignPurchases:function(){var t=this;return l(c().mark((function r(){return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:t.form.selectedProducts=[],t.form.purchase="",t.form.supplier?a.a.post(window.location.origin+"/api/supplier/filter-purchases",{products:t.form.product,supplierSlug:t.form.supplier.slug}).then((function(r){t.supplierPurchases=r.data.data})):(t.form.product="",t.form.supplier="");case 3:case"end":return r.stop()}}),r)})))()},storeProducts:function(){for(var t in this.form.selectedProducts=[],this.form.purchaseTotal=this.form.purchase.purchaseTotal,this.form.purchaseDue=this.form.purchase.due,this.form.purchaseTax=this.form.purchase.tax,this.form.newTax=this.form.purchase.tax,this.form.taxRate=this.form.purchase.taxRate,this.form.purchaseTransport=this.form.purchase.transport,this.form.purchaseDiscount=this.form.purchase.totalDiscount,this.form.newDue=this.form.purchase.due,this.form.newDueText=this.form.purchase.due,this.form.purchase.purchaseProducts){var r=this.form.purchase.purchaseProducts[t];this.form.selectedProducts.unshift({id:r.productID,slug:r.productSlug,name:r.productName,code:r.productCode,unit:r.productUnit,purchaseQty:r.quantity,totalReturnQty:Number(r.quantity)-Number(r.returnQty),returnQty:0,returnTotal:0,purchasePrice:r.unitCost,totalPrice:r.unitCostTotal})}this.calculateSum()},updateItem:function(t,r){var e=this.form.selectedProducts[r];e&&t>0&&(e.returnQty=Number(t),e.returnTotal=e.returnQty*e.purchasePrice,this.form.selectedProducts[r]=e),this.calculateSum()},calculateSum:function(){this.form.totalReturn=this.form.selectedProducts.reduce((function(t,r){return Number((t+r.returnTotal).toFixed(2))}),0),this.form.newSubTotal=this.form.selectedProducts.reduce((function(t,r){return Number((t+(r.purchaseQty-r.returnQty)*r.purchasePrice).toFixed(2))}),0),this.form.newTax=Number((this.form.taxRate/100*this.form.newSubTotal).toFixed(2)),this.form.purchaseTotal=this.form.newSubTotal+this.form.newTax+this.form.purchaseTransport-this.form.purchaseDiscount,this.form.purchaseDue=Number((this.form.purchaseTotal-this.form.purchase.totalPaid).toFixed(2)),this.form.purchaseDue>=0?(this.form.newDue=Number((this.form.purchaseTotal-this.form.purchase.totalPaid).toFixed(2)),this.form.newDueText=this.form.purchaseTotal+" - "+this.form.purchase.totalPaid+" = "+this.form.newDue,this.form.returnAmount=0):(this.form.returnAmount=(this.form.purchase.totalPaid-this.form.purchaseTotal).toFixed(2),this.form.returnAmountText=this.form.purchase.totalPaid+" - "+this.form.purchaseTotal+" = "+this.form.returnAmount,this.form.purchaseDue=0)},savePurchaseReturn:function(){var t=this;return l(c().mark((function r(){return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.form.post(window.location.origin+"/api/purchase-returns").then((function(r){var e=r.data;toast.fire({type:"success",title:t.$t("purchases.returns.create.success_msg")}),t.$router.push({name:"purchaseReturns.show",params:{slug:e.data.slug}})})).catch((function(){toast.fire({type:"error",title:t.$t("common.error_msg")})}));case 2:case"end":return r.stop()}}),r)})))()}}},h=e(1),d=Object(h.a)(f,(function(){var t=this,r=t.$createElement,e=t._self._c||r;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("purchases.returns.create.form_title"))+"\n ")]),t._v(" "),e("router-link",{staticClass:"btn btn-dark float-right",attrs:{to:{name:"purchaseReturns.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(r){return r.preventDefault(),t.savePurchaseReturn.apply(null,arguments)},keydown:function(r){return t.form.onKeydown(r)}}},[e("div",{staticClass:"card-body"},[t.items?e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"returnReason"}},[t._v(t._s(t.$t("purchases.returns.common.return_reason"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.returnReason,expression:"form.returnReason"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("returnReason")},attrs:{id:"returnReason",type:"text",name:"returnReason",placeholder:t.$t("purchases.returns.common.return_reason_placeholder")},domProps:{value:t.form.returnReason},on:{input:function(r){r.target.composing||t.$set(t.form,"returnReason",r.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"returnReason"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"supplier"}},[t._v(t._s(t.$t("common.supplier"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("v-select",{class:{"is-invalid":t.form.errors.has("supplier")},attrs:{options:t.items,label:"name",name:"supplier",placeholder:t.$t("common.supplier_placeholder")},on:{input:t.assignPurchases},model:{value:t.form.supplier,callback:function(r){t.$set(t.form,"supplier",r)},expression:"form.supplier"}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"supplier"}})],1)]):t._e(),t._v(" "),t.products&&!t.form.purchase?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")))]),t._v(" "),e("v-select",{class:{"is-invalid":t.form.errors.has("product")},attrs:{disabled:""==t.form.client,multiple:"",options:t.products,label:"label",name:"product",placeholder:t.$t("common.select_products_placeholder")},on:{input:t.assignPurchases},model:{value:t.form.product,callback:function(r){t.$set(t.form,"product",r)},expression:"form.product"}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"product"}})],1)]):t._e(),t._v(" "),t.form.supplier&&t.supplierPurchases?e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-12"},[e("label",{attrs:{for:"purchase"}},[t._v(t._s(t.$t("common.purchases"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("v-select",{class:{"is-invalid":t.form.errors.has("purchase")},attrs:{options:t.supplierPurchases,label:"purchaseNo",name:"purchase",placeholder:t.$t("common.purchases_placeholder")},on:{input:t.storeProducts},model:{value:t.form.purchase,callback:function(r){t.$set(t.form,"purchase",r)},expression:"form.purchase"}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"purchase"}})],1)]):t._e(),t._v(" "),t.form.selectedProducts&&t.form.selectedProducts.length>0?e("div",{staticClass:"row mt-3 mb-4"},[t.form.errors.errors&&t.form.errors.errors.selectedProducts?e("div",{staticClass:"w-95 m-auto"},t._l(t.form.errors.errors.selectedProducts,(function(r,o){return e("div",{key:o,staticClass:"callout callout-danger"},[e("p",[e("i",{staticClass:"icon fas fa-ban"}),t._v(" "+t._s(r))])])})),0):t._e(),t._v(" "),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.name")))]),t._v(" "),e("th",[t._v(t._s(t.$t("purchases.list.common.purchased_qty")))]),t._v(" "),e("th",[t._v(t._s(t.$t("purchases.list.common.current_qty")))]),t._v(" "),e("th",[t._v(t._s(t.$t("purchases.list.common.returned_qty")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.unit_cost")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.total_price")))]),t._v(" "),e("th",[t._v(t._s(t.$t("common.return_price")))])])]),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",[t._v(t._s(r.purchaseQty)+" "+t._s(r.unit))]),t._v(" "),e("td",[t._v(t._s(r.totalReturnQty)+" "+t._s(r.unit))]),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){t.updateItem(Number(r.returnQty)-1,o-1)}}}),t._v(" "),e("input",{staticClass:"quantity-field border-0 incrementor",attrs:{type:"number",step:"any",id:"returnQty-"+o,placeholder:"Return Qty",min:"0",max:r.purchaseQty},domProps:{value:r.returnQty},on:{change:function(r){return t.updateItem(r.target.value,o-1)},keyup:function(r){return t.updateItem(r.target.value,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){t.updateItem(r.returnQty>0?Number(r.returnQty)+1:1,o-1)}}})])]),t._v(" "),e("td",[t._v(t._s(t._f("withCurrency")(r.purchasePrice)))]),t._v(" "),e("td",[t._v(t._s(t._f("withCurrency")(r.totalPrice)))]),t._v(" "),e("td",[t._v(t._s(t._f("withCurrency")(r.returnTotal)))])])})),t._v(" "),t.form.purchase?e("tr",[e("td",{staticClass:"text-right",attrs:{colspan:"7"}},[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.purchase.subTotal)))])]),t._v(" "),e("td",[e("strong",[t._v(t._s(t._f("withCurrency")(t.form.totalReturn)))])])]):t._e()],2)])])]):t._e(),t._v(" "),t.form.purchase?e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"discount"}},[t._v(t._s(t.$t("purchases.list.common.discount")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.purchase.totalDiscount,expression:"form.purchase.totalDiscount"}],staticClass:"form-control",attrs:{id:"discount",type:"number",step:"any",name:"discount",readonly:""},domProps:{value:t.form.purchase.totalDiscount},on:{input:function(r){r.target.composing||t.$set(t.form.purchase,"totalDiscount",r.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"transportCost"}},[t._v(t._s(t.$t("purchases.list.common.transport_cost")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.purchase.transport,expression:"form.purchase.transport"}],staticClass:"form-control",attrs:{id:"transportCost",type:"number",step:"any",name:"transportCost",readonly:""},domProps:{value:t.form.purchase.transport},on:{input:function(r){r.target.composing||t.$set(t.form.purchase,"transport",r.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"purchaseTax"}},[t._v(t._s(t.$t("purchases.list.common.purchase_tax")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.newTax,expression:"form.newTax"}],staticClass:"form-control",attrs:{id:"purchaseTax",type:"number",step:"any",name:"purchaseTax",readonly:""},domProps:{value:t.form.newTax},on:{input:function(r){r.target.composing||t.$set(t.form,"newTax",r.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"purchaseTotal"}},[t._v(t._s(t.$t("purchases.list.common.purchase_total")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.purchaseTotal,expression:"form.purchaseTotal"}],staticClass:"form-control",attrs:{id:"purchaseTotal",type:"number",step:"any",name:"purchaseTotal",readonly:""},domProps:{value:t.form.purchaseTotal},on:{input:function(r){r.target.composing||t.$set(t.form,"purchaseTotal",r.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"totalPaid"}},[t._v(t._s(t.$t("common.total_paid")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.purchase.totalPaid,expression:"form.purchase.totalPaid"}],staticClass:"form-control",attrs:{id:"totalPaid",type:"number",step:"any",name:"totalPaid",readonly:""},domProps:{value:t.form.purchase.totalPaid},on:{input:function(r){r.target.composing||t.$set(t.form.purchase,"totalPaid",r.target.value)}}})]),t._v(" "),t.form.returnAmount>0?e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"returnAmountText"}},[t._v(t._s(t.$t("common.return_amount")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.returnAmountText,expression:"form.returnAmountText"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("returnAmountText")},attrs:{id:"returnAmountText",type:"text",name:"returnAmountText",readonly:""},domProps:{value:t.form.returnAmountText},on:{input:function(r){r.target.composing||t.$set(t.form,"returnAmountText",r.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"returnAmountText"}})],1):e("div",{staticClass:"form-group col-md-4"},[e("label",{attrs:{for:"newDueText"}},[t._v(t._s(t.$t("purchases.list.common.purchase_due")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.newDueText,expression:"form.newDueText"}],staticClass:"form-control",class:{"is-invalid":t.form.errors.has("newDueText")},attrs:{id:"newDueText",type:"text",name:"newDueText",readonly:""},domProps:{value:t.form.newDueText},on:{input:function(r){r.target.composing||t.$set(t.form,"newDueText",r.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"newDueText"}})],1)]):t._e(),t._v(" "),t.accounts&&t.form.returnAmount>0?e("div",{staticClass:"row"},[e("div",{staticClass:"form-group col-md-6"},[e("label",{attrs:{for:"account"}},[t._v(t._s(t.$t("common.account"))+"\n "),e("span",{staticClass:"required"},[t._v("*")])]),t._v(" "),e("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(r){t.$set(t.form,"account",r)},expression:"form.account"}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"account"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-3"},[e("label",{attrs:{for:"chequeNo"}},[t._v(t._s(t.$t("common.cheque_no")))]),t._v(" "),e("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(r){r.target.composing||t.$set(t.form,"chequeNo",r.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"chequeNo"}})],1),t._v(" "),e("div",{staticClass:"form-group col-md-3"},[e("label",{attrs:{for:"receiptNo"}},[t._v(t._s(t.$t("common.receipt_no")))]),t._v(" "),e("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(r){r.target.composing||t.$set(t.form,"receiptNo",r.target.value)}}}),t._v(" "),e("has-error",{attrs:{form:t.form,field:"receiptNo"}})],1)]):t._e(),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(r){r.target.composing||t.$set(t.form,"note",r.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("purchases.returns.common.return_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(r){r.target.composing||t.$set(t.form,"date",r.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(r){var e=Array.prototype.filter.call(r.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,"status",r.target.multiple?e:e[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-save"}),t._v(" "+t._s(t.$t("common.save"))+"\n ")]),t._v(" "),e("button",{staticClass:"btn btn-secondary float-right",attrs:{type:"reset"},on:{click:function(r){return t.form.reset()}}},[e("i",{staticClass:"fas fa-power-off"}),t._v(" "+t._s(t.$t("common.reset"))+"\n ")])],1)])])])])],1)}),[],!1,null,null,null);r.default=d.exports}}]);