"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([["edit_sale_return"],{

/***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=script&lang=js&":
/*!*****************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=script&lang=js& ***!
  \*****************************************************************************************************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
/* harmony import */ var nprogress__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! nprogress */ "./node_modules/nprogress/nprogress.js");
/* harmony import */ var nprogress__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(nprogress__WEBPACK_IMPORTED_MODULE_0__);
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  metaInfo: {
    title: "Edit Return"
  },
  data: function data() {
    return {
      isLoading: true,
      SubmitProcessing: false,
      details: [],
      detail: {},
      sale_return: {
        id: "",
        date: "",
        notes: "",
        statut: "",
        client_id: "",
        warehouse_id: "",
        sale_id: "",
        tax_rate: 0,
        TaxNet: 0,
        shipping: 0,
        discount: 0
      },
      total: 0,
      GrandTotal: 0
    };
  },
  computed: _objectSpread({}, (0,vuex__WEBPACK_IMPORTED_MODULE_1__.mapGetters)(["currentUser"])),
  methods: {
    //--- Submit Validate Update Sale Return
    Submit_Sale_return: function Submit_Sale_return() {
      var _this = this;
      this.$refs.edit_sale_return.validate().then(function (success) {
        if (!success) {
          _this.makeToast("danger", _this.$t("Please_fill_the_form_correctly"), _this.$t("Failed"));
        } else {
          _this.Update_Return();
        }
      });
    },
    //---Validate State Fields
    getValidationState: function getValidationState(_ref) {
      var dirty = _ref.dirty,
        validated = _ref.validated,
        _ref$valid = _ref.valid,
        valid = _ref$valid === void 0 ? null : _ref$valid;
      return dirty || validated ? valid : null;
    },
    //------ Toast
    makeToast: function makeToast(variant, msg, title) {
      this.$root.$bvToast.toast(msg, {
        title: title,
        variant: variant,
        solid: true
      });
    },
    //-----------------------------------Verified QTY ------------------------------\\
    Verified_Qty: function Verified_Qty(detail, id) {
      for (var i = 0; i < this.details.length; i++) {
        if (this.details[i].detail_id == id) {
          if (isNaN(detail.quantity)) {
            this.details[i].quantity = 1;
          }
          if (detail.quantity > detail.sale_quantity) {
            this.makeToast("warning", this.$t("qty_return_is_greater_than_qty_sold"), this.$t("Warning"));
            this.details[i].quantity = detail.sale_quantity;
          } else {
            this.details[i].quantity = detail.quantity;
          }
          this.Calcul_Total();
          this.$forceUpdate();
        }
      }
    },
    //-----------------------------------increment QTY ------------------------------\\
    increment: function increment(detail, id) {
      for (var i = 0; i < this.details.length; i++) {
        if (this.details[i].detail_id == id) {
          if (detail.quantity + 1 > detail.sale_quantity) {
            this.makeToast("warning", this.$t("qty_return_is_greater_than_qty_sold"), this.$t("Warning"));
          } else {
            this.formatNumber(this.details[i].quantity++, 2);
          }
        }
      }
      this.$forceUpdate();
      this.Calcul_Total();
    },
    //-----------------------------------decrement QTY ------------------------------\\
    decrement: function decrement(detail, id) {
      for (var i = 0; i < this.details.length; i++) {
        if (this.details[i].detail_id == id) {
          if (detail.quantity - 1 > 0) {
            if (detail.quantity - 1 > detail.sale_quantity) {
              this.makeToast("warning", this.$t("qty_return_is_greater_than_qty_sold"), this.$t("Warning"));
            } else {
              this.formatNumber(this.details[i].quantity--, 2);
            }
          }
        }
      }
      this.$forceUpdate();
      this.Calcul_Total();
    },
    //------------------------------Formetted Numbers -------------------------\\
    formatNumber: function formatNumber(number, dec) {
      var value = (typeof number === "string" ? number : number.toString()).split(".");
      if (dec <= 0) return value[0];
      var formated = value[1] || "";
      if (formated.length > dec) return "".concat(value[0], ".").concat(formated.substr(0, dec));
      while (formated.length < dec) formated += "0";
      return "".concat(value[0], ".").concat(formated);
    },
    //-----------------------------------------Calcul Total ------------------------------\\
    Calcul_Total: function Calcul_Total() {
      this.total = 0;
      for (var i = 0; i < this.details.length; i++) {
        var tax = this.details[i].taxe * this.details[i].quantity;
        this.details[i].subtotal = parseFloat(this.details[i].quantity * this.details[i].Net_price + tax);
        this.total = parseFloat(this.total + this.details[i].subtotal);
      }
      var total_without_discount = parseFloat(this.total - this.sale_return.discount);
      this.sale_return.TaxNet = parseFloat(total_without_discount * this.sale_return.tax_rate / 100);
      this.GrandTotal = parseFloat(total_without_discount + this.sale_return.TaxNet + this.sale_return.shipping);
      var grand_total = this.GrandTotal.toFixed(2);
      this.GrandTotal = parseFloat(grand_total);
    },
    //---------- keyup OrderTax
    keyup_OrderTax: function keyup_OrderTax() {
      if (isNaN(this.sale_return.tax_rate)) {
        this.sale_return.tax_rate = 0;
      } else if (this.sale_return.tax_rate == '') {
        this.sale_return.tax_rate = 0;
        this.Calcul_Total();
      } else {
        this.Calcul_Total();
      }
    },
    //---------- keyup Discount
    keyup_Discount: function keyup_Discount() {
      if (isNaN(this.sale_return.discount)) {
        this.sale_return.discount = 0;
      } else if (this.sale_return.discount == '') {
        this.sale_return.discount = 0;
        this.Calcul_Total();
      } else {
        this.Calcul_Total();
      }
    },
    //---------- keyup Shipping
    keyup_Shipping: function keyup_Shipping() {
      if (isNaN(this.sale_return.shipping)) {
        this.sale_return.shipping = 0;
      } else if (this.sale_return.shipping == '') {
        this.sale_return.shipping = 0;
        this.Calcul_Total();
      } else {
        this.Calcul_Total();
      }
    },
    //-----------------------------------Delete Detail Product ------------------------------\\
    // delete_Product_Detail(id) {
    //   for (var i = 0; i < this.details.length; i++) {
    //     if (id === this.details[i].detail_id) {
    //       this.details.splice(i, 1);
    //       this.Calcul_Total();
    //     }
    //   }
    // },
    //-----------------------------------verified Qty If Null || 0 ------------------------------\\
    verifiedForm: function verifiedForm() {
      if (this.details.length <= 0) {
        this.makeToast("warning", this.$t("AddProductToList"), this.$t("Warning"));
        return false;
      } else {
        var count = 0;
        for (var i = 0; i < this.details.length; i++) {
          if (this.details[i].quantity != "" || this.details[i].quantity !== 0) {
            count += 1;
          }
        }
        if (count === 0) {
          this.makeToast("warning", this.$t("Please_add_return_quantity"), this.$t("Warning"));
          return false;
        } else {
          return true;
        }
      }
    },
    //--------------------------------- Update Return -------------------------\\
    Update_Return: function Update_Return() {
      var _this2 = this;
      if (this.verifiedForm()) {
        this.SubmitProcessing = true;
        nprogress__WEBPACK_IMPORTED_MODULE_0___default().start();
        nprogress__WEBPACK_IMPORTED_MODULE_0___default().set(0.1);
        var id = this.$route.params.id;
        axios.put("returns/sale/".concat(id), {
          date: this.sale_return.date,
          client_id: this.sale_return.client_id,
          sale_id: this.sale_return.sale_id,
          warehouse_id: this.sale_return.warehouse_id,
          statut: this.sale_return.statut,
          notes: this.sale_return.notes,
          tax_rate: this.sale_return.tax_rate ? this.sale_return.tax_rate : 0,
          TaxNet: this.sale_return.TaxNet ? this.sale_return.TaxNet : 0,
          discount: this.sale_return.discount ? this.sale_return.discount : 0,
          shipping: this.sale_return.shipping ? this.sale_return.shipping : 0,
          GrandTotal: this.GrandTotal,
          details: this.details
        }).then(function (response) {
          nprogress__WEBPACK_IMPORTED_MODULE_0___default().done();
          _this2.makeToast("success", _this2.$t("Update.TitleReturn"), _this2.$t("Success"));
          _this2.SubmitProcessing = false;
          _this2.$router.push({
            name: "index_sale_return"
          });
        })["catch"](function (error) {
          nprogress__WEBPACK_IMPORTED_MODULE_0___default().done();
          _this2.makeToast("danger", _this2.$t("InvalidData"), _this2.$t("Failed"));
          _this2.SubmitProcessing = false;
        });
      }
    },
    //---------------------------------------Get Elements ------------------------------\\
    GetElements: function GetElements() {
      var _this3 = this;
      var id = this.$route.params.id;
      var sale_id = this.$route.params.sale_id;
      axios.get("returns/sale/edit_sell_return/".concat(id, "/").concat(sale_id)).then(function (response) {
        _this3.sale_return = response.data.sale_return;
        _this3.details = response.data.details;
        _this3.Calcul_Total();
        _this3.isLoading = false;
      })["catch"](function (response) {
        setTimeout(function () {
          _this3.isLoading = false;
        }, 500);
      });
    }
  },
  //----------------------------- Created function-------------------
  created: function created() {
    this.GetElements();
  }
});

/***/ }),

/***/ "./resources/src/views/app/pages/sale_return/edit_sale_return.vue":
/*!************************************************************************!*\
  !*** ./resources/src/views/app/pages/sale_return/edit_sale_return.vue ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _edit_sale_return_vue_vue_type_template_id_76fb84d7___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit_sale_return.vue?vue&type=template&id=76fb84d7& */ "./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=template&id=76fb84d7&");
/* harmony import */ var _edit_sale_return_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit_sale_return.vue?vue&type=script&lang=js& */ "./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=script&lang=js&");
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");





/* normalize component */
;
var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  _edit_sale_return_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  _edit_sale_return_vue_vue_type_template_id_76fb84d7___WEBPACK_IMPORTED_MODULE_0__.render,
  _edit_sale_return_vue_vue_type_template_id_76fb84d7___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "resources/src/views/app/pages/sale_return/edit_sale_return.vue"
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports);

/***/ }),

/***/ "./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=script&lang=js&":
/*!*************************************************************************************************!*\
  !*** ./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=script&lang=js& ***!
  \*************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_sale_return_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./edit_sale_return.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=script&lang=js&");
 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_sale_return_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 

/***/ }),

/***/ "./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=template&id=76fb84d7&":
/*!*******************************************************************************************************!*\
  !*** ./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=template&id=76fb84d7& ***!
  \*******************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   render: () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_sale_return_vue_vue_type_template_id_76fb84d7___WEBPACK_IMPORTED_MODULE_0__.render),
/* harmony export */   staticRenderFns: () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_sale_return_vue_vue_type_template_id_76fb84d7___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns)
/* harmony export */ });
/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_sale_return_vue_vue_type_template_id_76fb84d7___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./edit_sale_return.vue?vue&type=template&id=76fb84d7& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=template&id=76fb84d7&");


/***/ }),

/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=template&id=76fb84d7&":
/*!**********************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/src/views/app/pages/sale_return/edit_sale_return.vue?vue&type=template&id=76fb84d7& ***!
  \**********************************************************************************************************************************************************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   render: () => (/* binding */ render),
/* harmony export */   staticRenderFns: () => (/* binding */ staticRenderFns)
/* harmony export */ });
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"main-content"},[_c('breadcumb',{attrs:{"page":_vm.$t('EditSaleReturn'),"folder":_vm.$t('ListReturns')}}),_vm._v(" "),(_vm.isLoading)?_c('div',{staticClass:"loading_page spinner spinner-primary mr-3"}):_vm._e(),_vm._v(" "),(!_vm.isLoading)?_c('validation-observer',{ref:"edit_sale_return"},[_c('b-form',{on:{"submit":function($event){$event.preventDefault();return _vm.Submit_Sale_return.apply(null, arguments)}}},[_c('b-row',[_c('b-col',{attrs:{"lg":"12","md":"12","sm":"12"}},[_c('b-card',[_c('b-row',[_c('b-col',{staticClass:"mb-3",attrs:{"lg":"4","md":"4","sm":"12"}},[_c('validation-provider',{attrs:{"name":"date","rules":{ required: true}},scopedSlots:_vm._u([{key:"default",fn:function(validationContext){return [_c('b-form-group',{attrs:{"label":_vm.$t('date') + ' ' + '*'}},[_c('b-form-input',{attrs:{"state":_vm.getValidationState(validationContext),"aria-describedby":"date-feedback","type":"date"},model:{value:(_vm.sale_return.date),callback:function ($$v) {_vm.$set(_vm.sale_return, "date", $$v)},expression:"sale_return.date"}}),_vm._v(" "),_c('b-form-invalid-feedback',{attrs:{"id":"OrderTax-feedback"}},[_vm._v(_vm._s(validationContext.errors[0]))])],1)]}}],null,false,1946847383)})],1),_vm._v(" "),_c('b-col',{staticClass:"mb-3",attrs:{"lg":"4","md":"4","sm":"12"}},[_c('b-form-group',{attrs:{"label":_vm.$t('Sale')}},[_c('b-form-input',{attrs:{"label":"Sale","disabled":"disabled"},model:{value:(_vm.sale_return.sale_ref),callback:function ($$v) {_vm.$set(_vm.sale_return, "sale_ref", $$v)},expression:"sale_return.sale_ref"}})],1)],1),_vm._v(" "),_c('b-col',{staticClass:"mb-3",attrs:{"lg":"4","md":"4","sm":"12"}},[_c('validation-provider',{attrs:{"name":"Status","rules":{ required: true}},scopedSlots:_vm._u([{key:"default",fn:function(ref){
var valid = ref.valid;
var errors = ref.errors;
return _c('b-form-group',{attrs:{"label":_vm.$t('Status') + ' ' + '*'}},[_c('v-select',{class:{'is-invalid': !!errors.length},attrs:{"state":errors[0] ? false : (valid ? true : null),"reduce":function (label) { return label.value; },"placeholder":_vm.$t('Choose_Status'),"options":[
                                {label: 'Received', value: 'received'},
                                {label: 'Pending', value: 'pending'}
                              ]},model:{value:(_vm.sale_return.statut),callback:function ($$v) {_vm.$set(_vm.sale_return, "statut", $$v)},expression:"sale_return.statut"}}),_vm._v(" "),_c('b-form-invalid-feedback',[_vm._v(_vm._s(errors[0]))])],1)}}],null,false,3228354010)})],1),_vm._v(" "),_c('b-col',{attrs:{"md":"12"}},[_c('h5',[_vm._v(_vm._s(_vm.$t('list_product_returns'))+" *")]),_vm._v(" "),_c('div',{staticClass:"alert alert-danger"},[_vm._v(_vm._s(_vm.$t('products_refunded_alert')))]),_vm._v(" "),_c('div',{staticClass:"table-responsive"},[_c('table',{staticClass:"table table-hover"},[_c('thead',{staticClass:"bg-gray-300"},[_c('tr',[_c('th',{attrs:{"scope":"col"}},[_vm._v("#")]),_vm._v(" "),_c('th',{attrs:{"scope":"col"}},[_vm._v(_vm._s(_vm.$t('ProductName')))]),_vm._v(" "),_c('th',{attrs:{"scope":"col"}},[_vm._v(_vm._s(_vm.$t('Net_Unit_Price')))]),_vm._v(" "),_c('th',{attrs:{"scope":"col"}},[_vm._v(_vm._s(_vm.$t('Quantity_sold')))]),_vm._v(" "),_c('th',{attrs:{"scope":"col"}},[_vm._v(_vm._s(_vm.$t('Qty_return')))]),_vm._v(" "),_c('th',{attrs:{"scope":"col"}},[_vm._v(_vm._s(_vm.$t('Discount')))]),_vm._v(" "),_c('th',{attrs:{"scope":"col"}},[_vm._v(_vm._s(_vm.$t('Tax')))]),_vm._v(" "),_c('th',{attrs:{"scope":"col"}},[_vm._v(_vm._s(_vm.$t('SubTotal')))])])]),_vm._v(" "),_c('tbody',[(_vm.details.length <=0)?_c('tr',[_c('td',{attrs:{"colspan":"9"}},[_vm._v(_vm._s(_vm.$t('NodataAvailable')))])]):_vm._e(),_vm._v(" "),_vm._l((_vm.details),function(detail){return _c('tr',{key:detail.detail_id,class:{'row_deleted': detail.del === 1 || (detail.no_unit === 0 && detail.product_type != 'is_service')}},[_c('td',[_vm._v(_vm._s(detail.detail_id))]),_vm._v(" "),_c('td',[_c('span',[_vm._v(_vm._s(detail.code))]),_vm._v(" "),_c('br'),_vm._v(" "),_c('span',{staticClass:"badge badge-success"},[_vm._v(_vm._s(detail.name))])]),_vm._v(" "),_c('td',[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(_vm.formatNumber(detail.Net_price, 3)))]),_vm._v(" "),_c('td',[_c('span',{staticClass:"badge badge-outline-warning"},[_vm._v(_vm._s(detail.sale_quantity)+" "+_vm._s(detail.unitSale))])]),_vm._v(" "),_c('td',[_c('div',{staticClass:"quantity"},[_c('b-input-group',[_c('b-input-group-prepend',[_c('span',{directives:[{name:"show",rawName:"v-show",value:(detail.no_unit !== 0 || detail.product_type == 'is_service'),expression:"detail.no_unit !== 0 || detail.product_type == 'is_service'"}],staticClass:"btn btn-primary btn-sm",on:{"click":function($event){return _vm.decrement(detail ,detail.detail_id)}}},[_vm._v("-")])]),_vm._v(" "),_c('input',{directives:[{name:"model",rawName:"v-model.number",value:(detail.quantity),expression:"detail.quantity",modifiers:{"number":true}}],staticClass:"form-control",attrs:{"min":0.00,"disabled":detail.del === 1 || (detail.no_unit === 0 && detail.product_type != 'is_service')},domProps:{"value":(detail.quantity)},on:{"keyup":function($event){return _vm.Verified_Qty(detail,detail.detail_id)},"input":function($event){if($event.target.composing){ return; }_vm.$set(detail, "quantity", _vm._n($event.target.value))},"blur":function($event){return _vm.$forceUpdate()}}}),_vm._v(" "),_c('b-input-group-append',[_c('span',{directives:[{name:"show",rawName:"v-show",value:(detail.no_unit !== 0 || detail.product_type == 'is_service'),expression:"detail.no_unit !== 0 || detail.product_type == 'is_service'"}],staticClass:"btn btn-primary btn-sm",on:{"click":function($event){return _vm.increment(detail ,detail.detail_id)}}},[_vm._v("+")])])],1)],1)]),_vm._v(" "),_c('td',[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(_vm.formatNumber(detail.DiscountNet * detail.quantity, 2)))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(_vm.formatNumber(detail.taxe * detail.quantity, 2)))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(detail.subtotal.toFixed(2)))])])})],2)])])]),_vm._v(" "),_c('div',{staticClass:"offset-md-9 col-md-3 mt-4"},[_c('table',{staticClass:"table table-striped table-sm"},[_c('tbody',[_c('tr',[_c('td',{staticClass:"bold"},[_vm._v(_vm._s(_vm.$t('OrderTax')))]),_vm._v(" "),_c('td',[_c('span',[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(_vm.sale_return.TaxNet.toFixed(2))+" ("+_vm._s(_vm.formatNumber(_vm.sale_return.tax_rate ,2))+" %)")])])]),_vm._v(" "),_c('tr',[_c('td',{staticClass:"bold"},[_vm._v(_vm._s(_vm.$t('Discount')))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(_vm.sale_return.discount.toFixed(2)))])]),_vm._v(" "),_c('tr',[_c('td',{staticClass:"bold"},[_vm._v(_vm._s(_vm.$t('Shipping')))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(_vm.sale_return.shipping.toFixed(2)))])]),_vm._v(" "),_c('tr',[_c('td',[_c('span',{staticClass:"font-weight-bold"},[_vm._v(_vm._s(_vm.$t('Total')))])]),_vm._v(" "),_c('td',[_c('span',{staticClass:"font-weight-bold"},[_vm._v(_vm._s(_vm.currentUser.currency)+" "+_vm._s(_vm.GrandTotal.toFixed(2)))])])])])])]),_vm._v(" "),_c('b-col',{staticClass:"mb-3",attrs:{"lg":"4","md":"4","sm":"12"}},[_c('validation-provider',{attrs:{"name":"Order Tax","rules":{ regex: /^\d*\.?\d*$/}},scopedSlots:_vm._u([{key:"default",fn:function(validationContext){return [_c('b-form-group',{attrs:{"label":_vm.$t('OrderTax')}},[_c('b-input-group',{attrs:{"append":"%"}},[_c('b-form-input',{attrs:{"state":_vm.getValidationState(validationContext),"aria-describedby":"OrderTax-feedback","label":"Order Tax"},on:{"keyup":function($event){return _vm.keyup_OrderTax()}},model:{value:(_vm.sale_return.tax_rate),callback:function ($$v) {_vm.$set(_vm.sale_return, "tax_rate", _vm._n($$v))},expression:"sale_return.tax_rate"}})],1),_vm._v(" "),_c('b-form-invalid-feedback',{attrs:{"id":"OrderTax-feedback"}},[_vm._v(_vm._s(validationContext.errors[0]))])],1)]}}],null,false,2565157719)})],1),_vm._v(" "),_c('b-col',{staticClass:"mb-3",attrs:{"lg":"4","md":"4","sm":"12"}},[_c('validation-provider',{attrs:{"name":"Discount","rules":{ regex: /^\d*\.?\d*$/}},scopedSlots:_vm._u([{key:"default",fn:function(validationContext){return [_c('b-form-group',{attrs:{"label":_vm.$t('Discount')}},[_c('b-input-group',{attrs:{"append":_vm.currentUser.currency}},[_c('b-form-input',{attrs:{"state":_vm.getValidationState(validationContext),"aria-describedby":"Discount-feedback","label":"Discount"},on:{"keyup":function($event){return _vm.keyup_Discount()}},model:{value:(_vm.sale_return.discount),callback:function ($$v) {_vm.$set(_vm.sale_return, "discount", _vm._n($$v))},expression:"sale_return.discount"}})],1),_vm._v(" "),_c('b-form-invalid-feedback',{attrs:{"id":"Discount-feedback"}},[_vm._v(_vm._s(validationContext.errors[0]))])],1)]}}],null,false,535361776)})],1),_vm._v(" "),_c('b-col',{staticClass:"mb-3",attrs:{"lg":"4","md":"4","sm":"12"}},[_c('validation-provider',{attrs:{"name":"Shipping","rules":{ regex: /^\d*\.?\d*$/}},scopedSlots:_vm._u([{key:"default",fn:function(validationContext){return [_c('b-form-group',{attrs:{"label":_vm.$t('Shipping')}},[_c('b-input-group',{attrs:{"append":_vm.currentUser.currency}},[_c('b-form-input',{attrs:{"state":_vm.getValidationState(validationContext),"aria-describedby":"Shipping-feedback","label":"Shipping"},on:{"keyup":function($event){return _vm.keyup_Shipping()}},model:{value:(_vm.sale_return.shipping),callback:function ($$v) {_vm.$set(_vm.sale_return, "shipping", _vm._n($$v))},expression:"sale_return.shipping"}})],1),_vm._v(" "),_c('b-form-invalid-feedback',{attrs:{"id":"Shipping-feedback"}},[_vm._v(_vm._s(validationContext.errors[0]))])],1)]}}],null,false,1484868304)})],1),_vm._v(" "),_c('b-col',{attrs:{"md":"12"}},[_c('b-form-group',{attrs:{"label":_vm.$t('Please_provide_any_details')}},[_c('textarea',{directives:[{name:"model",rawName:"v-model",value:(_vm.sale_return.notes),expression:"sale_return.notes"}],staticClass:"form-control",attrs:{"rows":"4","placeholder":_vm.$t('Afewwords')},domProps:{"value":(_vm.sale_return.notes)},on:{"input":function($event){if($event.target.composing){ return; }_vm.$set(_vm.sale_return, "notes", $event.target.value)}}})])],1),_vm._v(" "),_c('b-col',{attrs:{"md":"12"}},[_c('b-form-group',[_c('b-button',{attrs:{"variant":"primary","disabled":_vm.SubmitProcessing},on:{"click":_vm.Submit_Sale_return}},[_c('i',{staticClass:"i-Yes me-2 font-weight-bold"}),_vm._v(" "+_vm._s(_vm.$t('submit')))]),_vm._v(" "),(_vm.SubmitProcessing)?_vm._m(0):_vm._e()],1)],1)],1)],1)],1)],1)],1)],1):_vm._e()],1)}
var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"typo__p"},[_c('div',{staticClass:"spinner sm spinner-primary mt-3"})])}]
render._withStripped = true


/***/ })

}]);