hesabixCore/public_html/webui/assets/mod-ad8165fd.js

2 lines
28 KiB
JavaScript
Raw Normal View History

2025-03-21 14:20:43 +03:30
import{_ as L,l as z,L as Y,a as u,S as n}from"./main-9b36f05f.js";import{a as r,o as p,s as h,b as a,w as i,F as j,_ as m,e as s,d as l,t as d,A as v,u as x,ab as w,ao as R}from"./vendor-adef9cb4.js";import"./vue-persian-datetime-picker.common-0e5ba5b7.js";import{q as O,a as G}from"./quickAddCommodity-50dce749.js";import{q as H}from"./quickAdd-3f821e67.js";import{m as J}from"./mostdes-26bfade0.js";import"./vue3-treeselect.common-f8cf97d9.js";/* empty css */const K={name:"mod",components:{Money3:z,Loading:Y,quickView:O,quickAdd:H,quickAddCommodity:G,mostdes:J},data:()=>({tabs:0,searchBuyDoc:"",addsheet:!1,editsheet:!1,priceList:[],selectedPriceList:{id:0,label:"پیشفرض"},maliyatCheck:!0,maliyatPercent:0,bid:{maliyatafzode:0},desSubmit:{id:"",des:""},sumSelected:0,sumTax:0,sumTotal:0,itemsSelected:[],items:[],headers:[{text:"کالا",value:"commodity.name"},{text:"شرح",value:"des"},{text:"تعداد/مقدار",value:"count"},{text:"مبلغ واحد",value:"price"},{text:"تخفیف",value:"discount"},{text:"مالیات",value:"tax"},{text:"جمع بدون مالیات",value:"sumWithoutTax"},{text:"مبلغ کل",value:"sumTotal"},{text:"عملیات",value:"operation"}],selectedPersonWithDet:{},loading:!1,canSubmit:!0,updateID:null,sum:0,balance:0,currencyConfig:{masked:!1,prefix:"",suffix:"ریال",thousands:",",decimal:".",precision:0,disableNegative:!0,disabled:!1,min:0,max:null,allowBlank:!1,minimumNumberOfCharacters:1,shouldRound:!1,focusOnRight:!0},unitConfig:{masked:!1,prefix:"",suffix:"",thousands:",",decimal:".",precision:0,disableNegative:!0,disabled:!1,allowBlank:!1,shouldRound:!1,focusOnRight:!0},data:{date:"",des:"",person:"",transferCost:0,discountAll:0},year:{},persons:[],commodity:[],units:[],itemData:{id:0,commodity:{unit:"",unitData:{name:"",floatNumber:0}},count:0,price:0,sumTotal:0,sumWithoutTax:0,tax:0,des:"",discount:0},editItemData:{index:0,id:0,commodity:{unit:"",unitData:{name:"",floatNumber:0}},count:0,price:0,sumTotal:0,sumWithoutTax:0,tax:0,des:"",discount:0},sms:!1}),watch:{"editItemData.price":function(){this.editCalc()},"editItemData.discount":function(){this.editCalc()},"editItemData.count":function(){this.editCalc()},"editItemData.commodity":function(e,t){e!=""&&e!=null&&(this.unitConfig.precision=this.editItemData.commodity.unitData.floatNumber,this.editItemData.des=this.editItemData.commodity.des)},"desSubmit.id":function(){this.data.des=this.desSubmit.des},"itemData.price":function(){this.calc()},"itemData.discount":function(){this.calc()},maliyatCheck:function(e){e===!1?this.maliyatPercent=0:this.maliyatPercent=this.bid.maliyatafzode},maliyatPercent:function(e){this.maliyatPercent==""&&(this.maliyatPercent=0),this.items.forEach((t,c)=>{t.sumWithoutTax=t.price*t.count-t.discount,t.tax=(t.price*t.count-t.discount)*e/100,t.sumTotal=(parseFloat(t.price)*parseFloat(t.count)-parseFloat(t.discount))*(100+parseFloat(this.maliyatPercent))/100})},"itemData.count":function(){this.calc()},"itemData.commodity":function(e,t){e!=""&&e!=null&&(this.selectedPriceList.id==0?this.itemData.price=this.itemData.commodity.priceSell:Array.from(this.itemData.commodity.prices).forEach(g=>{g.list.id==this.selectedPriceList.id&&(this.itemData.price=g.priceSell)}),this.unitConfig.precision=this.itemData.commodity.unitData.floatNumber,this.itemData.des=this.itemData.commodity.des)},itemsSelected:{handler:function(e,t){this.sumSelected=0,this.itemsSelected.forEach(c=>{this.sumSelected+=parseFloat(c.sumTotal)})},deep:!0},selectedPriceList:{handler:function(e,t){this.selectedPriceList.id==0?this.itemData.price=this.itemData.commodity.priceSell:Array.from(this.itemData.commodity.prices).forEach(g=>{g.list.id==this.selectedPriceList.id&&(this.itemData.price=g.priceSell)})},deep:!0},items:{handler:function(e,t){this.calcInvoice()},deep:!0},"data.transferCost":{handler:function(e,t){this.calcInvoice()},deep:!1},"data.discountAll":{handler:function(e,t){this.calcInvoice()},deep:!1},"data.person":{handler:function(e,t){u.post("/api/person/info/"+this.data.person.code).then(c=>{this.sele