PageSourceSearch

https://vachvach.ru/assets/LegalFields-C_on0Rjh.js

js vachvach.ru collected 2026-10-09 23:10:46 UTC 7,083 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./useRouter-H68mIy1c.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{rn as r,t as i}from"./go-UodXtyq4.js";import{c as a,m as o}from"./forms-Dy_syy6h.js";var s=e(t(),1),c=n(),l=`mt-1.5 h-12 w-full rounded-xl border border-line bg-mist px-4 text-sm outline-none focus:border-fg focus:bg-bg`;function u({value:e,onChange:t}){let n=o(e),u=(0,s.useRef)(n),f=(0,s.useRef)(t);u.current=n,f.current=t;let[p,m]=(0,s.useState)(``),h=(0,s.useRef)(n.inn);function g(e){t(o({...n,...e}))}(0,s.useEffect)(()=>{if(h.current===n.inn)return;h.current=n.inn;let e=n.inn;if(!a(e)){m(``);return}let t=!0,s=window.setTimeout(()=>{r(e).then(n=>{if(!t||n.inn&&n.inn!==e||(m(n.message||``),!n.found&&n.taxKind!==`self_employed`))return;let r=u.current;f.current(o({...r,taxKind:n.taxKind||r.taxKind,inn:e,legalName:n.legalName||r.legalName,ogrn:n.taxKind===`self_employed`?``:n.ogrn||r.ogrn,kpp:n.taxKind===`ooo`?n.kpp:``,address:n.taxKind===`ooo`?n.address:r.address}))}).catch(e=>{t&&m(e instanceof i&&e.message?e.message:`Реестр не ответил. Поля можно заполнить вручную.`)})},400);return()=>{t=!1,window.clearTimeout(s)}},[n.inn]);let _=n.taxKind!==`ooo`;return(0,c.jsxs)(`div`,{className:`space-y-3`,children:[(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Статус`,(0,c.jsxs)(`select`,{value:n.taxKind,onChange:e=>g({taxKind:e.target.value}),className:l,children:[(0,c.jsx)(`option`,{value:`self_employed`,children:`Самозанятый`}),(0,c.jsx)(`option`,{value:`ie`,children:`ИП`}),(0,c.jsx)(`option`,{value:`ooo`,children:`ООО`})]})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[_?`ФИО как в документах`:`Полное название`,(0,c.jsx)(`input`,{value:n.legalName,onChange:e=>g({legalName:e.target.value}),placeholder:_?`Иван Петров`:`ООО «Ромашка»`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ИНН`,(0,c.jsx)(`input`,{value:n.inn,onChange:e=>g({inn:e.target.value.replace(/\D/g,``).slice(0,12)}),inputMode:`numeric`,required:!0,placeholder:`10 или 12 цифр`,className:l}),p?(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:p}):null]}),n.taxKind===`ooo`?(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`КПП`,(0,c.jsx)(`input`,{value:n.kpp,onChange:e=>g({kpp:e.target.value.replace(/\D/g,``).slice(0,9)}),inputMode:`numeric`,placeholder:`9 цифр`,className:l})]}):null,n.taxKind===`self_employed`?null:(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[n.taxKind===`ie`?`ОГРНИП`:`ОГРН`,(0,c.jsx)(`input`,{value:n.ogrn,onChange:e=>g({ogrn:e.target.value.replace(/\D/g,``).slice(0,n.taxKind===`ie`?15:13)}),inputMode:`numeric`,className:l})]}),n.taxKind===`self_employed`?(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:`Налог на профессиональный доход, без НДС. Чек гостю печатает площадка, а доход всё равно нужно провести в «Мой налог».`}):(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Налог`,(0,c.jsxs)(`select`,{value:n.taxSystem,onChange:e=>g({taxSystem:e.target.value}),className:l,children:[(0,c.jsx)(`option`,{value:`usn_income`,children:`УСН, доходы`}),(0,c.jsx)(`option`,{value:`usn_income_outcome`,children:`УСН, доходы минус расходы`}),n.taxKind===`ie`?(0,c.jsx)(`option`,{value:`patent`,children:`Патент`}):null,n.taxKind===`ie`?(0,c.jsx)(`option`,{value:`npd`,children:`НПД, самозанятый ИП`}):null,(0,c.jsx)(`option`,{value:`osn`,children:`ОСН, с НДС`})]})]}),n.taxKind===`ie`&&n.taxSystem===`npd`?(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:`В чеке будет «ИП» и ваше имя, без НДС. Доход по НПД также проводится в «Мой налог».`}):null,n.taxSystem===`usn_income`||n.taxSystem===`usn_income_outcome`?(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`НДС в чеке`,(0,c.jsxs)(`select`,{value:n.vat,onChange:e=>g({vat:e.target.value}),className:l,children:[(0,c.jsx)(`option`,{value:`none`,children:`Без НДС`}),(0,c.jsx)(`option`,{value:`5`,children:`НДС 5%`}),(0,c.jsx)(`option`,{value:`7`,children:`НДС 7%`})]})]}):null,n.taxSystem===`osn`?(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:`В чеке будет НДС 22%.`}):null,n.taxKind===`ooo`?(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Юридический адрес`,(0,c.jsx)(`input`,{value:n.address,onChange:e=>g({address:e.target.value}),required:!0,placeholder:`Как в ЕГРЮЛ`,className:l}),(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:`Будет виден гостям на странице организатора.`})]}):(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Адрес`,(0,c.jsx)(`input`,{value:n.address,onChange:e=>g({address:e.target.value}),placeholder:`Необязательно`,className:l}),(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:`Только в вашем кабинете. На сайте его Ð
1½Ðµ показываем.`})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Телефон для чека`,(0,c.jsx)(`input`,{value:n.phone,onChange:e=>g({phone:e.target.value}),inputMode:`tel`,required:!0,placeholder:`+7 900 000-00-00`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Расчётный счёт`,(0,c.jsx)(`input`,{value:n.account,onChange:e=>g({account:e.target.value.replace(/\D/g,``).slice(0,20)}),inputMode:`numeric`,required:!0,placeholder:`20 цифр`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`БИК`,(0,c.jsx)(`input`,{value:n.bik,onChange:e=>g({bik:e.target.value.replace(/\D/g,``).slice(0,9)}),inputMode:`numeric`,required:!0,placeholder:`9 цифр`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Банк`,(0,c.jsx)(`input`,{value:n.bankName,onChange:e=>g({bankName:e.target.value}),required:!0,placeholder:`ТБанк`,className:l}),(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:`Сюда переводим 85%. Эти данные видны только в кабинете.`})]}),(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:d(n)})]})}function d(e){let t=e.legalName.trim();return`В чеке гостя: агент ООО «ВАЧВАЧ». Поставщик — ${e.taxKind===`ie`&&t&&!t.toUpperCase().startsWith(`ИП `)?`ИП ${t}`:t||`имя поставщика`}, ИНН ${e.inn||`ИНН`}, ${e.phone||`телефон`}, ${e.vat===`22`?`НДС 22%`:e.vat===`5`?`НДС 5%`:e.vat===`7`?`НДС 7%`:`без НДС`}.`}export{u as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.