10 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import{u as C,z as _,j as S,H as y,c as r,bs as t,I as f,cc as u,cd as b,L as v,fx as T}from"./bundle.dc1ed9be.js";import{E as k,A as h,a as g,t as M}from"./bundle.81ef2fd0.js";import{u as $}from"./bundle.ecc5a203.js";function E(e){var l,d,o,s,c,m;const[n]=C(),i=_();return S(y,{children:[e.page==="edit"&&r(t,{leftSide:n("status"),children:r(k,{transaction:e.transaction})}),r(t,{required:!0,leftSide:n("type"),children:r(f,{style:{color:i.$3,colorScheme:i.$0},value:e.transaction.base_type===h.Credit?g.Deposit:g.Withdrawal,onValueChange:a=>e.handleChange("base_type",a===g.Deposit?h.Credit:h.Debit),errorMessage:(l=e.errors)==null?void 0:l.errors.base_type,cypressRef:"transactionTypeSelector",children:Object.values(M).map(a=>r("option",{value:a,children:n(a)},a))})}),r(t,{leftSide:n("date"),children:r(u,{style:{color:i.$3,colorScheme:i.$0},type:"date",value:e.transaction.date,onValueChange:a=>e.handleChange("date",a),errorMessage:(d=e.errors)==null?void 0:d.errors.date})}),r(t,{leftSide:n("amount"),children:r(b,{border:!0,precision:e.currencySeparators.precision,className:"auto",value:e.transaction.amount.toString(),onChange:a=>e.handleChange("amount",Number(a)),errorMessage:(o=e.errors)==null?void 0:o.errors.amount})}),r(t,{required:!0,leftSide:n("currency"),children:r(v,{value:e.transaction.currency_id,onChange:a=>e.handleChange("currency_id",a),errorMessage:(s=e.errors)==null?void 0:s.errors.currency_id})}),r(t,{required:!0,leftSide:n("bank_account"),children:r(T,{value:e.transaction.bank_integration_id,onChange:a=>e.handleChange("bank_integration_id",a.id),onClearButtonClick:()=>e.handleChange("bank_integration_id",""),errorMessage:(c=e.errors)==null?void 0:c.errors.bank_integration_id})}),r(t,{leftSide:n("description"),children:r(u,{style:{color:i.$3,colorScheme:i.$0},element:"textarea",value:e.transaction.description,onValueChange:a=>e.handleChange("description",a),errorMessage:(m=e.errors)==null?void 0:m.errors.description})}),e.page==="edit"&&S(y,{children:[e.transaction.participant&&r(t,{leftSide:n("participant"),children:r(u,{value:e.transaction.participant,readOnly:!0})}),e.transaction.participant_name&&r(t,{leftSide:n("participant_name"),children:r(u,{value:e.transaction.participant_name,readOnly:!0})})]})]})}/**
 | 
						|
 * Invoice Ninja (https://invoiceninja.com).
 | 
						|
 *
 | 
						|
 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
						|
 *
 | 
						|
 * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
 | 
						|
 *
 | 
						|
 * @license https://www.elastic.co/licensing/elastic-license
 | 
						|
 */function q(e){const n=$(),{setErrors:i,setCurrencySeparators:l,setTransaction:d}=e;return(o,s)=>{if(i(void 0),o==="currency_id"){const c=n(s.toString());c&&l(c)}d(c=>c&&{...c,[o]:s})}}export{E as T,q as u};
 |