Files
docker-invoiceninja/docker/app/public/bundle.7b1ed156.js
2024-10-19 18:17:42 +00:00

10 lines
2.7 KiB
JavaScript

import{u as C,z as _,j as S,H as y,c as r,bt as t,I as f,cj as u,ck as b,L as v,fD as k}from"./bundle.2fc363c8.js";import{E as T,A as h,a as g,t as M}from"./bundle.422d70fb.js";import{u as $}from"./bundle.c8cf99d4.js";function D(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(T,{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(),onValueChange: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(k,{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 E(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{D as T,E as u};