Compare commits

...

60 Commits
5.0.0 ... 5.0.3

Author SHA1 Message Date
ed6268aa7b add 503 setting migration 2021-12-03 21:15:05 +05:30
8a7ea53ffb new build 2021-12-03 21:13:44 +05:30
aba0a340a4 Merge branch 'master' 2021-12-03 21:09:37 +05:30
423e30b16e fix docker configuration 2021-12-03 21:03:58 +05:30
0cafe8c4b8 Update license text 2021-12-02 21:04:21 +05:30
2a1b1ff7b7 Update License to AGPL 2021-12-02 21:01:04 +05:30
e498740466 Update copyright 2021-12-02 19:40:18 +05:30
9b66bb2b5a Merge pull request #614 from Jeffrey-H/readme_update
Checked new functionalities from the 5.0 update.
2021-12-02 19:39:03 +05:30
5321871cda fix: update_version migration 2021-12-02 19:03:01 +05:30
4438d54401 new build 502 2021-12-02 18:01:22 +05:30
8cd384d5ac responsive fix for estimates filters 2021-12-02 17:56:37 +05:30
6022e8997d Checked new functionalities from the 5.0 update. And seperated some combined functionalities 2021-12-02 13:21:52 +01:00
236759ed5c Merge branch 'master' 2021-12-02 17:49:53 +05:30
3934025d67 fix docker issue 2021-12-02 17:49:10 +05:30
468eb40949 Merge branch 'add_status_estimate' into 'master'
add status filter
2021-12-02 12:17:26 +00:00
658e125555 add status filter 2021-12-02 12:17:26 +00:00
5b50dadd91 Merge branch 'add_status' into 'master'
add status dropdown and due tab

See merge request mohit.panjvani/crater-web!1312
2021-12-02 10:32:07 +00:00
04fbbe7b2a restyle invoice filters on medium size screens 2021-12-02 16:00:04 +05:30
cd68d7e2ab Merge branch 'user-delete-issue' into 'master'
solve delete users and create template issue

See merge request mohit.panjvani/crater-web!1310
2021-12-02 10:08:24 +00:00
cb2b5f0ca3 add status dropdown and due tab 2021-12-02 15:11:17 +05:30
887d5d0685 solve template issue 2021-12-02 14:46:53 +05:30
6bdd0f9477 Merge branch 'master' 2021-12-02 14:16:27 +05:30
f99b8b4a1c fix base_due_amount calculation 2021-12-02 14:16:12 +05:30
7a45ed0982 solve delete users and create template issue 2021-12-02 12:38:56 +05:30
d066efd3ce Merge branch 'minor-fixes-v5' into 'master'
fix filter issues

See merge request mohit.panjvani/crater-web!1309
2021-12-02 07:08:49 +00:00
a6654c4519 fix filter issues 2021-12-02 12:18:43 +05:30
90b5a1f906 Merge branch 'payment-reset' into 'master'
fix: on customer change remove selected invoice

See merge request mohit.panjvani/crater-web!1308
2021-12-02 06:44:18 +00:00
0545cdbe6f fix: on customer chanage remove selected invoice 2021-12-02 11:57:33 +05:30
a4becbbc96 Merge branch 'user-ablity' into 'master'
fix: dashboard ability issue

See merge request mohit.panjvani/crater-web!1306
2021-12-02 05:55:36 +00:00
faf8c804a9 fix: dashboard ability issue 2021-12-02 10:31:16 +05:30
6c1fc8e514 fix build errors 501 2021-12-01 19:32:16 +05:30
618d644c14 new build 501 2021-12-01 19:23:31 +05:30
deaab665dd Merge branch 'master' 2021-12-01 19:22:24 +05:30
aa6553233a Fix mark as accepted not updating state 2021-12-01 13:52:12 +00:00
d839962292 Fix mark as accepted not updating state 2021-12-01 13:52:12 +00:00
4d14b1552f new build 501 2021-12-01 19:20:53 +05:30
e1ef208073 Merge branch 'recurring-index-refresh' into 'master'
Recurring index  delete refresh page

See merge request mohit.panjvani/crater-web!1303
2021-12-01 13:44:28 +00:00
40f3415e28 Merge branch 'compnay-fix' into 'master'
fix: company save loader on duplicate name error

See merge request mohit.panjvani/crater-web!1304
2021-12-01 13:28:38 +00:00
5c39525a2b fix: company save loader on duplicate name error 2021-12-01 18:57:33 +05:30
3a5901c70d Merge branch 'master' of https://gitlab.com/mohit.panjvani/crater-web into recurring-index-refresh 2021-12-01 18:35:30 +05:30
d978557366 fix 2021-12-01 18:35:13 +05:30
f97868d98a Merge branch 'quantity-fix' into 'master'
fix: exchange rate

See merge request mohit.panjvani/crater-web!1302
2021-12-01 12:57:12 +00:00
91e369ddcc new build 2021-12-01 18:02:08 +05:30
8806fe76ad Merge branch 'overlap-page' into 'master'
fix : overlap page in view and index pages

See merge request mohit.panjvani/crater-web!1299
2021-12-01 12:26:50 +00:00
cfc7e2231c fix: some minor changes 2021-12-01 17:53:26 +05:30
64326dd5f3 Merge branch 'v5-issues' into 'master'
V5 issues

See merge request mohit.panjvani/crater-web!1301
2021-12-01 12:08:37 +00:00
dee14455bb fix: exchange rate 2021-12-01 17:21:37 +05:30
9403fe265e fix expense currency issue 2021-12-01 17:06:20 +05:30
e30b99a730 fix currency issue 2021-12-01 16:24:23 +05:30
c1fb29bdbf Merge branch 'master' 2021-12-01 16:19:18 +05:30
6ea74a79bb Merge branch 'fix-unit-tests-master' into 'master'
solve unit tests

See merge request mohit.panjvani/crater-web!1298
2021-12-01 10:49:04 +00:00
8d94f4efbe fix code style 2021-12-01 16:18:27 +05:30
cc52cde16c add predis 2021-12-01 16:14:11 +05:30
e16e4c6d52 fix : overlap page in view and index pages 2021-12-01 16:04:55 +05:30
e22f60ff16 fix issues 2021-12-01 14:46:25 +05:30
88bfb38b56 solve unit tests 2021-12-01 13:25:24 +05:30
f57fa41640 Merge branch 'quantity-fix' into 'master'
fix: quantity decimal value not allow

See merge request mohit.panjvani/crater-web!1297
2021-12-01 06:57:09 +00:00
0f99568eaf fix: quantity decimal value not allow 2021-12-01 11:48:32 +05:30
f3dad8d48b fix issues 2021-11-30 21:55:25 +05:30
9629771d22 fix migration error 2021-11-30 19:20:51 +05:30
176 changed files with 1812 additions and 740 deletions

View File

@ -1,44 +1,40 @@
FROM php:7.4-fpm-alpine
FROM php:7.4-fpm
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
libmagickwand-dev \
mariadb-client
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pecl install imagick \
&& docker-php-ext-enable imagick
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl bcmath gd
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# Set working directory
WORKDIR /var/www
RUN apk add --no-cache \
$PHPIZE_DEPS \
freetype-dev \
git \
zip \
libzip-dev \
php7-bcmath \
curl \
unzip \
libjpeg-turbo-dev \
libpng-dev \
libxml2-dev \
mariadb-client \
sqlite \
php7-json \
php7-openssl \
php7-pdo \
php7-pdo_mysql \
php7-session \
php7-simplexml \
php7-tokenizer \
php7-xml \
imagemagick \
imagemagick-libs \
imagemagick-dev \
php7-imagick \
php7-pcntl \
--repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ gnu-libiconv=1.15-r3
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
RUN printf "\n" | pecl install \
imagick && \
docker-php-ext-enable --ini-name 20-imagick.ini imagick
RUN docker-php-ext-configure zip
RUN docker-php-ext-install zip
RUN docker-php-ext-install iconv pdo pdo_mysql bcmath pcntl exif
RUN docker-php-ext-configure gd --with-jpeg --with-freetype
RUN docker-php-ext-install gd
USER $user

702
LICENSE
View File

@ -1,47 +1,661 @@
Copyright (c) 2019 by Bytefury
Crater Invoice * https://www.craterapp.com
"Easy Invoicing"
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
All Rights Reserved
ATTRIBUTION ASSURANCE LICENSE (adapted from the original BSD license)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the conditions below are met.
These conditions require a modest attribution to CraterApp.com (the
"Author"), who hopes that its promotional value may help justify the
thousands of dollars in otherwise billable time invested in writing
this and other freely available, open-source software.
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
1. Redistributions of source code, in whole or part and with or without
modification (the "Code"), must prominently display this GPG-signed
text in verifiable form.
2. Redistributions of the Code in binary form must be accompanied by
this GPG-signed text in any documentation and, each time the resulting
executable program or a program dependent thereon is launched, a
prominent display (e.g., splash screen or banner text) of the Author's
attribution information, which includes:
(a) Name ("Bytefury"),
(b) Professional identification ("Crater Invoice"), and
(c) URL ("https://www.craterapp.com").
3. Neither the name nor any trademark of the Author may be used to
endorse or promote products derived from this software without specific
prior written permission.
4. Users are entirely responsible, to the exclusion of the Author and
any other persons, for compliance with (1) regulations set by owners or
administrators of employed equipment, (2) licensing terms of any other
software, and (3) local regulations regarding use, including those
regarding import, export, and use of encryption software.
Preamble
THIS FREE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR OR ANY CONTRIBUTOR BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
EFFECTS OF UNAUTHORIZED OR MALICIOUS NETWORK ACCESS;
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View File

@ -52,6 +52,7 @@ class CreateTemplateCommand extends Command
}
Storage::disk('views')->copy("/app/pdf/{$type}/{$type}1.blade.php", "/app/pdf/{$type}/{$templateName}.blade.php");
copy(public_path("/build/img/PDF/{$type}1.png"), public_path("/build/img/PDF/{$templateName}.png"));
copy(resource_path("/static/img/PDF/{$type}1.png"), resource_path("/static/img/PDF/{$templateName}.png"));
$path = resource_path("app/pdf/{$type}/{$templateName}.blade.php");

View File

@ -27,17 +27,19 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('check:invoices:status')
if (\Storage::disk('local')->has('database_created')) {
$schedule->command('check:invoices:status')
->daily();
$schedule->command('check:estimates:status')
$schedule->command('check:estimates:status')
->daily();
$recurringInvoices = RecurringInvoice::where('status', 'ACTIVE')->get();
foreach ($recurringInvoices as $recurringInvoice) {
$schedule->call(function () use ($recurringInvoice) {
$recurringInvoice->generateInvoice();
})->cron($recurringInvoice->frequency);
$recurringInvoices = RecurringInvoice::where('status', 'ACTIVE')->get();
foreach ($recurringInvoices as $recurringInvoice) {
$schedule->call(function () use ($recurringInvoice) {
$recurringInvoice->generateInvoice();
})->cron($recurringInvoice->frequency);
}
}
}

View File

@ -45,6 +45,8 @@ class ForgotPasswordController extends Controller
*/
protected function sendResetLinkFailedResponse(Request $request, $response)
{
return response('Email could not be sent to this email address.', 403);
return response()->json([
'error' => 'Email could not be sent to this email address.'
], 403);
}
}

View File

@ -5,7 +5,6 @@ namespace Crater\Http\Requests;
use Crater\Models\Address;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rule;
class CustomerRequest extends FormRequest

View File

@ -86,13 +86,15 @@ class EstimatesRequest extends FormRequest
$companyCurrency = CompanySetting::getSetting('currency', $this->header('company'));
$customerCurrency = Customer::find($this->customer_id)->currency_id;
$customer = Customer::find($this->customer_id);
if ((string)$customerCurrency !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
if ($companyCurrency && $customer) {
if ((string)$customer->currency_id !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
}
if ($this->isMethod('PUT')) {
$rules['estimate_number'] = [
@ -115,7 +117,7 @@ class EstimatesRequest extends FormRequest
return collect($this->except('items', 'taxes'))
->merge([
'creator_id' => $this->user()->id,
'creator_id' => $this->user()->id ?? null,
'status' => $this->has('estimateSend') ? Estimate::STATUS_SENT : Estimate::STATUS_DRAFT,
'company_id' => $this->header('company'),
'tax_per_item' => CompanySetting::getSetting('tax_per_item', $this->header('company')) ?? 'NO ',

View File

@ -53,11 +53,13 @@ class ExpenseRequest extends FormRequest
],
];
if ($companyCurrency !== $this->currency_id) {
$rules['exchange_rate'] = [
'required',
];
};
if ($companyCurrency && $this->currency_id) {
if ($companyCurrency !== $this->currency_id) {
$rules['exchange_rate'] = [
'required',
];
};
}
return $rules;
}

View File

@ -86,13 +86,15 @@ class InvoicesRequest extends FormRequest
$companyCurrency = CompanySetting::getSetting('currency', $this->header('company'));
$customerCurrency = Customer::find($this->customer_id)->currency_id;
$customer = Customer::find($this->customer_id);
if ((string)$customerCurrency !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
if ($customer && $companyCurrency) {
if ((string)$customer->currency_id !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
}
if ($this->isMethod('PUT')) {
$rules['invoice_number'] = [
@ -115,7 +117,7 @@ class InvoicesRequest extends FormRequest
return collect($this->except('items', 'taxes'))
->merge([
'creator_id' => $this->user()->id,
'creator_id' => $this->user()->id ?? null,
'status' => $this->has('invoiceSend') ? Invoice::STATUS_SENT : Invoice::STATUS_DRAFT,
'paid_status' => Invoice::STATUS_UNPAID,
'company_id' => $this->header('company'),

View File

@ -65,13 +65,15 @@ class PaymentRequest extends FormRequest
$companyCurrency = CompanySetting::getSetting('currency', $this->header('company'));
$customerCurrency = Customer::find($this->customer_id)->currency_id;
$customer = Customer::find($this->customer_id);
if ((string)$customerCurrency !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
if ($customer && $companyCurrency) {
if ((string)$customer->currency_id !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
}
return $rules;
}

View File

@ -83,13 +83,15 @@ class RecurringInvoiceRequest extends FormRequest
]
];
$customerCurrency = Customer::find($this->customer_id)->currency_id;
$customer = Customer::find($this->customer_id);
if ((string)$customerCurrency !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
if ($customer && $companyCurrency) {
if ((string)$customer->currency_id !== $companyCurrency) {
$rules['exchange_rate'] = [
'required',
];
};
}
return $rules;
}

View File

@ -389,6 +389,7 @@ class Invoice extends Model implements HasMedia
}
$data['due_amount'] = ($this->due_amount + $oldTotal);
$data['base_due_amount'] = $data['due_amount'] * $data['exchange_rate'];
$data['customer_sequence_number'] = $serial->nextCustomerSequenceNumber;
$this->changeInvoiceStatus($data['due_amount']);
@ -660,6 +661,7 @@ class Invoice extends Model implements HasMedia
public function addInvoicePayment($amount)
{
$this->due_amount += $amount;
$this->base_due_amount = $this->due_amount * $this->exchange_rate;
$this->changeInvoiceStatus($this->due_amount);
}
@ -667,6 +669,7 @@ class Invoice extends Model implements HasMedia
public function subtractInvoicePayment($amount)
{
$this->due_amount -= $amount;
$this->base_due_amount = $this->due_amount * $this->exchange_rate;
$this->changeInvoiceStatus($this->due_amount);
}

View File

@ -104,6 +104,11 @@ class User extends Authenticatable implements HasMedia
return $this->hasMany(Customer::class, 'creator_id');
}
public function recurringInvoices()
{
return $this->hasMany(RecurringInvoice::class, 'creator_id');
}
public function currency()
{
return $this->belongsTo(Currency::class);
@ -119,11 +124,6 @@ class User extends Authenticatable implements HasMedia
return $this->belongsToMany(Company::class, 'user_company', 'user_id', 'company_id');
}
public function recurringInvoices()
{
return $this->hasMany(RecurringInvoice::class, 'creator_id');
}
public function expenses()
{
return $this->hasMany(Expense::class, 'creator_id');
@ -388,7 +388,7 @@ class User extends Authenticatable implements HasMedia
if (Schema::hasColumn('companies', 'owner_id')) {
$company = Company::find(request()->header('company'));
if ($company && $this->id === $company->owner_id) {
if ($company && $this->id == $company->owner_id) {
return true;
}
} else {

View File

@ -21,7 +21,7 @@ class CompanyPolicy
public function delete(User $user, Company $company)
{
if ($user->id === $company->owner_id) {
if ($user->id == $company->owner_id) {
return true;
}
@ -30,7 +30,7 @@ class CompanyPolicy
public function transferOwnership(User $user, Company $company)
{
if ($user->id === $company->owner_id) {
if ($user->id == $company->owner_id) {
return true;
}

View File

@ -51,7 +51,7 @@ class SerialNumberFormatter
$this->nextSequenceNumber = $this->ob->sequence_number;
}
if (isSet($this->ob) && isSet($this->ob->customer_sequence_number) && isSet($this->customer) && $this->ob->customer_id == $this->customer->id) {
if (isset($this->ob) && isset($this->ob->customer_sequence_number) && isset($this->customer) && $this->ob->customer_id == $this->customer->id) {
$this->nextCustomerSequenceNumber = $this->ob->customer_sequence_number;
}

View File

@ -8,7 +8,7 @@ trait ExchangeRateProvidersTrait
{
public function getExchangeRate($filter, $baseCurrencyCode, $currencyCode)
{
switch ($filter['driver']) {
switch ($filter['driver']) {
case 'currency_freak':
$url = "https://api.currencyfreaks.com/latest?apikey=".$filter['key'];

View File

@ -26,6 +26,7 @@
"laravel/ui": "^3.0",
"lavary/laravel-menu": "^1.8",
"league/flysystem-aws-s3-v3": "^1.0",
"predis/predis": "^1.1",
"silber/bouncer": "v1.0.0-rc.10",
"spatie/flysystem-dropbox": "^1.2",
"spatie/laravel-backup": "^6.11",

70
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "eb81aa1e30524298d27332065ccf6d5d",
"content-hash": "9d8087cbb95748c4e8c30e34800da3a0",
"packages": [
{
"name": "asm89/stack-cors",
@ -4863,6 +4863,72 @@
],
"time": "2021-09-25T07:38:51+00:00"
},
{
"name": "predis/predis",
"version": "v1.1.9",
"source": {
"type": "git",
"url": "https://github.com/predis/predis.git",
"reference": "c50c3393bb9f47fa012d0cdfb727a266b0818259"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/predis/predis/zipball/c50c3393bb9f47fa012d0cdfb727a266b0818259",
"reference": "c50c3393bb9f47fa012d0cdfb727a266b0818259",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"suggest": {
"ext-curl": "Allows access to Webdis when paired with phpiredis",
"ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol"
},
"type": "library",
"autoload": {
"psr-4": {
"Predis\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniele Alessandri",
"email": "suppakilla@gmail.com",
"homepage": "http://clorophilla.net",
"role": "Creator & Maintainer"
},
{
"name": "Till Krüss",
"homepage": "https://till.im",
"role": "Maintainer"
}
],
"description": "Flexible and feature-complete Redis client for PHP and HHVM",
"homepage": "http://github.com/predis/predis",
"keywords": [
"nosql",
"predis",
"redis"
],
"support": {
"issues": "https://github.com/predis/predis/issues",
"source": "https://github.com/predis/predis/tree/v1.1.9"
},
"funding": [
{
"url": "https://github.com/sponsors/tillkruss",
"type": "github"
}
],
"time": "2021-10-05T19:02:38+00:00"
},
{
"name": "psr/container",
"version": "1.1.2",
@ -12237,5 +12303,5 @@
"php": "^7.4 || ^8.0"
},
"platform-dev": [],
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}

View File

@ -41,44 +41,54 @@ class UpdateCustomerIdInAllTables extends Migration
});
}
$user->addresses->map(function ($address) use ($newCustomer) {
if ($address) {
$address->customer_id = $newCustomer->id;
$address->user_id = null;
$address->save();
}
});
if ($user->addresses()->exists()) {
$user->addresses->map(function ($address) use ($newCustomer) {
if ($address) {
$address->customer_id = $newCustomer->id;
$address->user_id = null;
$address->save();
}
});
}
$user->expenses->map(function ($expense) use ($newCustomer) {
if ($expense) {
$expense->customer_id = $newCustomer->id;
$expense->user_id = null;
$expense->save();
}
});
if ($user->expenses()->exists()) {
$user->expenses->map(function ($expense) use ($newCustomer) {
if ($expense) {
$expense->customer_id = $newCustomer->id;
$expense->user_id = null;
$expense->save();
}
});
}
$user->estimates->map(function ($estimate) use ($newCustomer) {
if ($estimate) {
$estimate->customer_id = $newCustomer->id;
$estimate->user_id = null;
$estimate->save();
}
});
if ($user->estimates()->exists()) {
$user->estimates->map(function ($estimate) use ($newCustomer) {
if ($estimate) {
$estimate->customer_id = $newCustomer->id;
$estimate->user_id = null;
$estimate->save();
}
});
}
$user->invoices->map(function ($invoice) use ($newCustomer) {
if ($invoice) {
$invoice->customer_id = $newCustomer->id;
$invoice->user_id = null;
$invoice->save();
}
});
if ($user->invoices()->exists()) {
$user->invoices->map(function ($invoice) use ($newCustomer) {
if ($invoice) {
$invoice->customer_id = $newCustomer->id;
$invoice->user_id = null;
$invoice->save();
}
});
}
$user->payments->map(function ($payment) use ($newCustomer) {
if ($payment) {
$payment->customer_id = $newCustomer->id;
$payment->save();
}
});
if ($user->payments()->exists()) {
$user->payments->map(function ($payment) use ($newCustomer) {
if ($payment) {
$payment->customer_id = $newCustomer->id;
$payment->save();
}
});
}
}
}

View File

@ -26,7 +26,7 @@ class AddOwnerIdToCompaniesTable extends Migration
$companies = Company::all();
if ($companies) {
if ($companies && $user) {
foreach ($companies as $company) {
$company->owner_id = $user->id;
$company->slug = Str::slug($company->name);

View File

@ -16,8 +16,7 @@ class AddBaseColumnsToExpenseTable extends Migration
Schema::table('expenses', function (Blueprint $table) {
$table->decimal('exchange_rate', 19, 6)->nullable();
$table->unsignedBigInteger('base_amount')->nullable();
$table->unsignedInteger('currency_id');
$table->foreign('currency_id')->references('id')->on('currencies');
$table->unsignedInteger('currency_id')->nullable();
});
}

View File

@ -0,0 +1,27 @@
<?php
use Crater\Models\Setting;
use Illuminate\Database\Migrations\Migration;
class UpdateCraterVersion501 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Setting::setSetting('version', '5.0.1');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -0,0 +1,34 @@
<?php
use Crater\Models\Invoice;
use Illuminate\Database\Migrations\Migration;
class CalculateBaseDueAmount extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$invoices = Invoice::all();
foreach ($invoices as $invoice) {
if ($invoice->exchange_rate) {
$invoice->base_due_amount = $invoice->due_amount * $invoice->exchange_rate;
$invoice->save();
}
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Str;
class MigrateTemplatesFromVersion4 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$templates = Storage::disk('views')->files('/app/pdf/invoice');
foreach ($templates as $key => $template) {
$templateName = Str::before(basename($template), '.blade.php');
if (! file_exists(resource_path("/static/img/PDF/{$templateName}.png"))) {
copy(public_path("/assets/img/PDF/{$templateName}.png"), public_path("/build/img/PDF/{$templateName}.png"));
copy(public_path("/assets/img/PDF/{$templateName}.png"), resource_path("/static/img/PDF/{$templateName}.png"));
}
}
$templates = Storage::disk('views')->files('/app/pdf/estimate');
foreach ($templates as $key => $template) {
$templateName = Str::before(basename($template), '.blade.php');
if (! file_exists(resource_path("/static/img/PDF/{$templateName}.png"))) {
copy(public_path("/assets/img/PDF/{$templateName}.png"), public_path("/build/img/PDF/{$templateName}.png"));
copy(public_path("/assets/img/PDF/{$templateName}.png"), resource_path("/static/img/PDF/{$templateName}.png"));
}
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -0,0 +1,27 @@
<?php
use Crater\Models\Setting;
use Illuminate\Database\Migrations\Migration;
class UpdateCraterVersion502 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Setting::setSetting('version', '5.0.2');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -0,0 +1,27 @@
<?php
use Crater\Models\Setting;
use Illuminate\Database\Migrations\Migration;
class UpdateCraterVersion503 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Setting::setSetting('version', '5.0.3');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -1,4 +1,4 @@
version: '3.7'
version: '3'
services:
app:
@ -39,7 +39,7 @@ services:
image: nginx:1.17-alpine
restart: unless-stopped
ports:
- 8080:80
- 80:80
volumes:
- ./:/var/www
- ./docker-compose/nginx:/etc/nginx/conf.d/
@ -50,7 +50,6 @@ services:
build:
context: ./
dockerfile: ./docker-compose/cron.dockerfile
container_name: cron
volumes:
- ./:/var/www
networks:

View File

@ -1 +1 @@
var h=Object.defineProperty,z=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var b=(u,s,i)=>s in u?h(u,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[s]=i,U=(u,s)=>{for(var i in s||(s={}))E.call(s,i)&&b(u,i,s[i]);if(V)for(var i of V(s))P.call(s,i)&&b(u,i,s[i]);return u},S=(u,s)=>z(u,L(s));import{g as Q,i as B,k as I,m as v,n as y,a2 as T,p as H,aQ as J,j as K,q as O,r as m,o as C,c as W,b as r,w as d,y as e,a0 as X,s as Y,z as Z,A as x,v as ee,x as ae,B as se,t as te}from"./vendor.e9042f2c.js";import{d as ne,m as oe,c as re}from"./main.d8ec3f25.js";const le=["onSubmit"],ie=te("span",null,null,-1),pe={setup(u){const s=ne(),i=oe(),q=re(),{t:g}=Q();let p=B(!1),w=B(null),f=B([]);s.currentUser.avatar&&f.value.push({image:s.currentUser.avatar});const F=I(()=>({name:{required:v.withMessage(g("validation.required"),y)},email:{required:v.withMessage(g("validation.required"),y),email:v.withMessage(g("validation.email_incorrect"),T)},password:{minLength:v.withMessage(g("validation.password_length",{count:8}),H(8))},confirm_password:{sameAsPassword:v.withMessage(g("validation.password_incorrect"),J(t.password))}})),t=K({name:s.currentUser.name,email:s.currentUser.email,language:s.currentUserSettings.language||q.selectedCompanySettings.language,password:"",confirm_password:""}),o=O(F,I(()=>t));function M(l,a){w.value=a}function k(){w.value=null}async function G(){if(o.value.$touch(),o.value.$invalid)return!0;p.value=!0;let l={name:t.name,email:t.email};try{if(t.password!=null&&t.password!==void 0&&t.password!==""&&(l=S(U({},l),{password:t.password})),s.currentUserSettings.language!==t.language&&await s.updateUserSettings({settings:{language:t.language}}),(await s.updateCurrentUser(l)).data.data){if(p.value=!1,w.value){let $=new FormData;$.append("admin_avatar",w.value),await s.uploadAvatar($)}t.password="",t.confirm_password=""}}catch{return p.value=!1,!0}}return(l,a)=>{const $=m("BaseFileUploader"),c=m("BaseInputGroup"),_=m("BaseInput"),N=m("BaseMultiselect"),A=m("BaseInputGrid"),D=m("BaseIcon"),j=m("BaseButton"),R=m("BaseSettingCard");return C(),W("form",{class:"relative",onSubmit:se(G,["prevent"])},[r(R,{title:l.$t("settings.account_settings.account_settings"),description:l.$t("settings.account_settings.section_description")},{default:d(()=>[r(A,null,{default:d(()=>[r(c,{label:l.$tc("settings.account_settings.profile_picture")},{default:d(()=>[r($,{modelValue:e(f),"onUpdate:modelValue":a[0]||(a[0]=n=>X(f)?f.value=n:f=n),avatar:!0,accept:"image/*",onChange:M,onRemove:k},null,8,["modelValue"])]),_:1},8,["label"]),ie,r(c,{label:l.$tc("settings.account_settings.name"),error:e(o).name.$error&&e(o).name.$errors[0].$message,required:""},{default:d(()=>[r(_,{modelValue:e(t).name,"onUpdate:modelValue":a[1]||(a[1]=n=>e(t).name=n),invalid:e(o).name.$error,onInput:a[2]||(a[2]=n=>e(o).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),r(c,{label:l.$tc("settings.account_settings.email"),error:e(o).email.$error&&e(o).email.$errors[0].$message,required:""},{default:d(()=>[r(_,{modelValue:e(t).email,"onUpdate:modelValue":a[3]||(a[3]=n=>e(t).email=n),invalid:e(o).email.$error,onInput:a[4]||(a[4]=n=>e(o).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),r(c,{error:e(o).password.$error&&e(o).password.$errors[0].$message,label:l.$tc("settings.account_settings.password")},{default:d(()=>[r(_,{modelValue:e(t).password,"onUpdate:modelValue":a[5]||(a[5]=n=>e(t).password=n),type:"password",onInput:a[6]||(a[6]=n=>e(o).password.$touch())},null,8,["modelValue"])]),_:1},8,["error","label"]),r(c,{label:l.$tc("settings.account_settings.confirm_password"),error:e(o).confirm_password.$error&&e(o).confirm_password.$errors[0].$message},{default:d(()=>[r(_,{modelValue:e(t).confirm_password,"onUpdate:modelValue":a[7]||(a[7]=n=>e(t).confirm_password=n),type:"password",onInput:a[8]||(a[8]=n=>e(o).confirm_password.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"]),r(c,{label:l.$tc("settings.language")},{default:d(()=>[r(N,{modelValue:e(t).language,"onUpdate:modelValue":a[9]||(a[9]=n=>e(t).language=n),options:e(i).config.languages,label:"name","value-prop":"code","track-by":"code","open-direction":"top"},null,8,["modelValue","options"])]),_:1},8,["label"])]),_:1}),r(j,{loading:e(p),disabled:e(p),class:"mt-6"},{left:d(n=>[e(p)?x("",!0):(C(),Y(D,{key:0,name:"SaveIcon",class:Z(n.class)},null,8,["class"]))]),default:d(()=>[ee(" "+ae(l.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title","description"])],40,le)}}};export{pe as default};
var h=Object.defineProperty,z=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var b=(u,s,i)=>s in u?h(u,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[s]=i,U=(u,s)=>{for(var i in s||(s={}))E.call(s,i)&&b(u,i,s[i]);if(V)for(var i of V(s))P.call(s,i)&&b(u,i,s[i]);return u},S=(u,s)=>z(u,L(s));import{g as Q,i as B,k as I,m as v,n as y,a2 as T,p as H,aQ as J,j as K,q as O,r as m,o as C,c as W,b as r,w as d,y as e,a0 as X,s as Y,z as Z,A as x,v as ee,x as ae,B as se,t as te}from"./vendor.e9042f2c.js";import{d as ne,m as oe,c as re}from"./main.9d655092.js";const le=["onSubmit"],ie=te("span",null,null,-1),pe={setup(u){const s=ne(),i=oe(),q=re(),{t:g}=Q();let p=B(!1),w=B(null),f=B([]);s.currentUser.avatar&&f.value.push({image:s.currentUser.avatar});const F=I(()=>({name:{required:v.withMessage(g("validation.required"),y)},email:{required:v.withMessage(g("validation.required"),y),email:v.withMessage(g("validation.email_incorrect"),T)},password:{minLength:v.withMessage(g("validation.password_length",{count:8}),H(8))},confirm_password:{sameAsPassword:v.withMessage(g("validation.password_incorrect"),J(t.password))}})),t=K({name:s.currentUser.name,email:s.currentUser.email,language:s.currentUserSettings.language||q.selectedCompanySettings.language,password:"",confirm_password:""}),o=O(F,I(()=>t));function M(l,a){w.value=a}function k(){w.value=null}async function G(){if(o.value.$touch(),o.value.$invalid)return!0;p.value=!0;let l={name:t.name,email:t.email};try{if(t.password!=null&&t.password!==void 0&&t.password!==""&&(l=S(U({},l),{password:t.password})),s.currentUserSettings.language!==t.language&&await s.updateUserSettings({settings:{language:t.language}}),(await s.updateCurrentUser(l)).data.data){if(p.value=!1,w.value){let $=new FormData;$.append("admin_avatar",w.value),await s.uploadAvatar($)}t.password="",t.confirm_password=""}}catch{return p.value=!1,!0}}return(l,a)=>{const $=m("BaseFileUploader"),c=m("BaseInputGroup"),_=m("BaseInput"),N=m("BaseMultiselect"),A=m("BaseInputGrid"),D=m("BaseIcon"),j=m("BaseButton"),R=m("BaseSettingCard");return C(),W("form",{class:"relative",onSubmit:se(G,["prevent"])},[r(R,{title:l.$t("settings.account_settings.account_settings"),description:l.$t("settings.account_settings.section_description")},{default:d(()=>[r(A,null,{default:d(()=>[r(c,{label:l.$tc("settings.account_settings.profile_picture")},{default:d(()=>[r($,{modelValue:e(f),"onUpdate:modelValue":a[0]||(a[0]=n=>X(f)?f.value=n:f=n),avatar:!0,accept:"image/*",onChange:M,onRemove:k},null,8,["modelValue"])]),_:1},8,["label"]),ie,r(c,{label:l.$tc("settings.account_settings.name"),error:e(o).name.$error&&e(o).name.$errors[0].$message,required:""},{default:d(()=>[r(_,{modelValue:e(t).name,"onUpdate:modelValue":a[1]||(a[1]=n=>e(t).name=n),invalid:e(o).name.$error,onInput:a[2]||(a[2]=n=>e(o).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),r(c,{label:l.$tc("settings.account_settings.email"),error:e(o).email.$error&&e(o).email.$errors[0].$message,required:""},{default:d(()=>[r(_,{modelValue:e(t).email,"onUpdate:modelValue":a[3]||(a[3]=n=>e(t).email=n),invalid:e(o).email.$error,onInput:a[4]||(a[4]=n=>e(o).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),r(c,{error:e(o).password.$error&&e(o).password.$errors[0].$message,label:l.$tc("settings.account_settings.password")},{default:d(()=>[r(_,{modelValue:e(t).password,"onUpdate:modelValue":a[5]||(a[5]=n=>e(t).password=n),type:"password",onInput:a[6]||(a[6]=n=>e(o).password.$touch())},null,8,["modelValue"])]),_:1},8,["error","label"]),r(c,{label:l.$tc("settings.account_settings.confirm_password"),error:e(o).confirm_password.$error&&e(o).confirm_password.$errors[0].$message},{default:d(()=>[r(_,{modelValue:e(t).confirm_password,"onUpdate:modelValue":a[7]||(a[7]=n=>e(t).confirm_password=n),type:"password",onInput:a[8]||(a[8]=n=>e(o).confirm_password.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"]),r(c,{label:l.$tc("settings.language")},{default:d(()=>[r(N,{modelValue:e(t).language,"onUpdate:modelValue":a[9]||(a[9]=n=>e(t).language=n),options:e(i).config.languages,label:"name","value-prop":"code","track-by":"code","open-direction":"top"},null,8,["modelValue","options"])]),_:1},8,["label"])]),_:1}),r(j,{loading:e(p),disabled:e(p),class:"mt-6"},{left:d(n=>[e(p)?x("",!0):(C(),Y(D,{key:0,name:"SaveIcon",class:Z(n.class)},null,8,["class"]))]),default:d(()=>[ee(" "+ae(l.$tc("settings.company_info.save")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["title","description"])],40,le)}}};export{pe as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{g as k,i as q,k as g,m as y,n as N,p as j,a4 as D,q as G,r as i,o as B,s as b,w as r,t as m,v,x as C,y as e,b as n,z as L,A as T,B as z}from"./vendor.e9042f2c.js";import{s as A,g as E}from"./main.9d655092.js";const U={class:"flex justify-between w-full"},X=["onSubmit"],F={class:"p-8 sm:p-6"},H={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},P={setup(J){const t=A(),u=E(),{t:p}=k();let c=q(!1);const h=g(()=>({currentCategory:{name:{required:y.withMessage(p("validation.required"),N),minLength:y.withMessage(p("validation.name_min_length",{count:3}),j(3))},description:{maxLength:y.withMessage(p("validation.description_maxlength",{count:255}),D(255))}}})),a=G(h,g(()=>t)),w=g(()=>u.active&&u.componentName==="CategoryModal");async function I(){if(a.value.currentCategory.$touch(),a.value.currentCategory.$invalid)return!0;const s=t.isEdit?t.updateCategory:t.addCategory;c.value=!0,await s(t.currentCategory),c.value=!1,u.refreshData&&u.refreshData(),d()}function d(){u.closeModal(),setTimeout(()=>{t.$reset(),a.value.$reset()},300)}return(s,o)=>{const f=i("BaseIcon"),x=i("BaseInput"),_=i("BaseInputGroup"),V=i("BaseTextarea"),M=i("BaseInputGrid"),$=i("BaseButton"),S=i("BaseModal");return B(),b(S,{show:e(w),onClose:d},{header:r(()=>[m("div",U,[v(C(e(u).title)+" ",1),n(f,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[m("form",{action:"",onSubmit:z(I,["prevent"])},[m("div",F,[n(M,{layout:"one-column"},{default:r(()=>[n(_,{label:s.$t("expenses.category"),error:e(a).currentCategory.name.$error&&e(a).currentCategory.name.$errors[0].$message,required:""},{default:r(()=>[n(x,{modelValue:e(t).currentCategory.name,"onUpdate:modelValue":o[0]||(o[0]=l=>e(t).currentCategory.name=l),invalid:e(a).currentCategory.name.$error,type:"text",onInput:o[1]||(o[1]=l=>e(a).currentCategory.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),n(_,{label:s.$t("expenses.description"),error:e(a).currentCategory.description.$error&&e(a).currentCategory.description.$errors[0].$message},{default:r(()=>[n(V,{modelValue:e(t).currentCategory.description,"onUpdate:modelValue":o[2]||(o[2]=l=>e(t).currentCategory.description=l),rows:"4",cols:"50",onInput:o[3]||(o[3]=l=>e(a).currentCategory.description.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"])]),_:1})]),m("div",H,[n($,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:d},{default:r(()=>[v(C(s.$t("general.cancel")),1)]),_:1}),n($,{loading:e(c),disabled:e(c),variant:"primary",type:"submit"},{left:r(l=>[e(c)?T("",!0):(B(),b(f,{key:0,name:"SaveIcon",class:L(l.class)},null,8,["class"]))]),default:r(()=>[v(" "+C(e(t).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,X)]),_:1},8,["show"])}}};export{P as _};

View File

@ -1 +0,0 @@
import{g as k,i as q,k as g,m as y,n as N,p as j,a4 as D,q as G,r as i,o as B,s as b,w as r,t as m,v as f,x as v,y as e,b as n,z as L,A as T,B as z}from"./vendor.e9042f2c.js";import{s as A,g as E}from"./main.d8ec3f25.js";const U={class:"flex justify-between w-full"},X=["onSubmit"],F={class:"p-8 sm:p-6"},H={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},P={setup(J){const t=A(),u=E(),{t:p}=k();let c=q(!1);const h=g(()=>({currentCategory:{name:{required:y.withMessage(p("validation.required"),N),minLength:y.withMessage(p("validation.name_min_length",{count:3}),j(3))},description:{maxLength:y.withMessage(p("validation.description_maxlength",{count:255}),D(255))}}})),a=G(h,g(()=>t)),w=g(()=>u.active&&u.componentName==="CategoryModal");async function I(){if(a.value.currentCategory.$touch(),a.value.currentCategory.$invalid)return!0;const s=t.isEdit?t.updateCategory:t.addCategory;c.value=!0,await s(t.currentCategory),c.value=!1,u.refreshData&&u.refreshData(),d()}function d(){u.closeModal(),setTimeout(()=>{t.$reset(),a.value.$reset()},300)}return(s,o)=>{const C=i("BaseIcon"),x=i("BaseInput"),_=i("BaseInputGroup"),V=i("BaseTextarea"),M=i("BaseInputGrid"),$=i("BaseButton"),S=i("BaseModal");return B(),b(S,{show:e(w),onClose:d},{header:r(()=>[m("div",U,[f(v(e(u).title)+" ",1),n(C,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[m("form",{action:"",onSubmit:z(I,["prevent"])},[m("div",F,[n(M,{layout:"one-column"},{default:r(()=>[n(_,{label:s.$t("expenses.category"),error:e(a).currentCategory.name.$error&&e(a).currentCategory.name.$errors[0].$message,required:""},{default:r(()=>[n(x,{modelValue:e(t).currentCategory.name,"onUpdate:modelValue":o[0]||(o[0]=l=>e(t).currentCategory.name=l),invalid:e(a).currentCategory.name.$error,type:"text",onInput:o[1]||(o[1]=l=>e(a).currentCategory.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),n(_,{label:s.$t("expenses.description"),error:e(a).currentCategory.description.$error&&e(a).currentCategory.description.$errors[0].$message},{default:r(()=>[n(V,{modelValue:e(t).currentCategory.description,"onUpdate:modelValue":o[2]||(o[2]=l=>e(t).currentCategory.description=l),rows:"4",cols:"50",onInput:o[3]||(o[3]=l=>e(a).currentCategory.description.$touch())},null,8,["modelValue"])]),_:1},8,["label","error"])]),_:1})]),m("div",H,[n($,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:d},{default:r(()=>[f(v(s.$t("general.cancel")),1)]),_:1}),n($,{loading:e(c),disabled:e(c),variant:"primary",type:"submit"},{left:r(l=>[e(c)?T("",!0):(B(),b(C,{key:0,name:"SaveIcon",class:L(l.class)},null,8,["class"]))]),default:r(()=>[f(" "+v(e(t).isEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,X)]),_:1},8,["show"])}}};export{P as _};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
var D=Object.defineProperty,I=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&f(e,r,t[r]);if(y)for(var r of y(t))h.call(t,r)&&f(e,r,t[r]);return e},v=(e,t)=>I(e,g(t));import{g as w,m as V,aU as j,q as F,k as T,aJ as L,r as E,o as n,s as m,w as P,an as A,y as c,f as S,D as x,c as b,b as O,F as R,H as k,A as B,h as C}from"./vendor.e9042f2c.js";import{n as i,l as Y}from"./main.d8ec3f25.js";function $(e){switch(e){case"./types/DateTimeType.vue":return i(()=>import("./DateTimeType.885ed58f.js"),["assets/DateTimeType.885ed58f.js","assets/vendor.e9042f2c.js"]);case"./types/DateType.vue":return i(()=>import("./DateType.7fd6d385.js"),["assets/DateType.7fd6d385.js","assets/vendor.e9042f2c.js"]);case"./types/DropdownType.vue":return i(()=>import("./DropdownType.84b4a057.js"),["assets/DropdownType.84b4a057.js","assets/vendor.e9042f2c.js"]);case"./types/InputType.vue":return i(()=>import("./InputType.abbc9e84.js"),["assets/InputType.abbc9e84.js","assets/vendor.e9042f2c.js"]);case"./types/NumberType.vue":return i(()=>import("./NumberType.bae67e72.js"),["assets/NumberType.bae67e72.js","assets/vendor.e9042f2c.js"]);case"./types/PhoneType.vue":return i(()=>import("./PhoneType.f1778217.js"),["assets/PhoneType.f1778217.js","assets/vendor.e9042f2c.js"]);case"./types/SwitchType.vue":return i(()=>import("./SwitchType.56df61e7.js"),["assets/SwitchType.56df61e7.js","assets/vendor.e9042f2c.js"]);case"./types/TextAreaType.vue":return i(()=>import("./TextAreaType.a1bccab5.js"),["assets/TextAreaType.a1bccab5.js","assets/vendor.e9042f2c.js"]);case"./types/TimeType.vue":return i(()=>import("./TimeType.82e5beb3.js"),["assets/TimeType.82e5beb3.js","assets/vendor.e9042f2c.js"]);case"./types/UrlType.vue":return i(()=>import("./UrlType.803fb838.js"),["assets/UrlType.803fb838.js","assets/vendor.e9042f2c.js"]);default:return new Promise(function(t,r){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+e)))})}}const M={props:{field:{type:Object,required:!0},customFieldScope:{type:String,required:!0},index:{type:Number,required:!0},store:{type:Object,required:!0},storeProp:{type:String,required:!0}},setup(e){const t=e,{t:r}=w(),d={value:{required:V.withMessage(r("validation.required"),j(t.field.is_required))}},a=F(d,T(()=>t.field),{$scope:t.customFieldScope}),o=T(()=>t.field.type?L(()=>$(`./types/${t.field.type}Type.vue`)):!1);return(u,s)=>{const l=E("BaseInputGroup");return n(),m(l,{label:e.field.label,required:!!e.field.is_required,error:c(a).value.$error&&c(a).value.$errors[0].$message},{default:P(()=>[(n(),m(A(c(o)),{modelValue:e.field.value,"onUpdate:modelValue":s[0]||(s[0]=p=>e.field.value=p),options:e.field.options,invalid:c(a).value.$error,placeholder:e.field.placeholder},null,8,["modelValue","options","invalid","placeholder"]))]),_:1},8,["label","required","error"])}}},H={key:0},J={props:{store:{type:Object,required:!0},storeProp:{type:String,required:!0},isEdit:{type:Boolean,default:!1},type:{type:String,default:null},gridLayout:{type:String,default:"two-column"},isLoading:{type:Boolean,default:null},customFieldScope:{type:String,required:!0}},setup(e){const t=e,r=Y();a();function d(){t.isEdit&&t.store[t.storeProp].fields.forEach(o=>{const u=t.store[t.storeProp].customFields.findIndex(s=>s.id===o.custom_field_id);if(u>-1){let s=o.default_answer;s&&o.custom_field.type==="DateTime"&&(s=C(o.default_answer,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm")),t.store[t.storeProp].customFields[u]=v(_({},o),{id:o.custom_field_id,value:s,label:o.custom_field.label,options:o.custom_field.options,is_required:o.custom_field.is_required,placeholder:o.custom_field.placeholder,order:o.custom_field.order})}})}async function a(){let u=(await r.fetchCustomFields({type:t.type,limit:"all"})).data.data;u.map(s=>s.value=s.default_answer),t.store[t.storeProp].customFields=S.sortBy(u,s=>s.order),d()}return x(()=>t.store[t.storeProp].fields,o=>{d()}),(o,u)=>{const s=E("BaseInputGrid");return e.store[e.storeProp]&&e.store[e.storeProp].customFields.length>0&&!e.isLoading?(n(),b("div",H,[O(s,{layout:e.gridLayout},{default:P(()=>[(n(!0),b(R,null,k(e.store[e.storeProp].customFields,(l,p)=>(n(),m(M,{key:l.id,"custom-field-scope":e.customFieldScope,store:e.store,"store-prop":e.storeProp,index:p,field:l},null,8,["custom-field-scope","store","store-prop","index","field"]))),128))]),_:1},8,["layout"])])):B("",!0)}}};export{J as _};
var D=Object.defineProperty,I=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&f(e,r,t[r]);if(y)for(var r of y(t))h.call(t,r)&&f(e,r,t[r]);return e},v=(e,t)=>I(e,g(t));import{g as w,m as V,aU as j,q as F,k as T,aJ as L,r as E,o as n,s as m,w as P,an as A,y as c,f as S,D as x,c as b,b as O,F as R,H as k,A as B,h as C}from"./vendor.e9042f2c.js";import{n as i,l as Y}from"./main.9d655092.js";function $(e){switch(e){case"./types/DateTimeType.vue":return i(()=>import("./DateTimeType.885ed58f.js"),["assets/DateTimeType.885ed58f.js","assets/vendor.e9042f2c.js"]);case"./types/DateType.vue":return i(()=>import("./DateType.7fd6d385.js"),["assets/DateType.7fd6d385.js","assets/vendor.e9042f2c.js"]);case"./types/DropdownType.vue":return i(()=>import("./DropdownType.84b4a057.js"),["assets/DropdownType.84b4a057.js","assets/vendor.e9042f2c.js"]);case"./types/InputType.vue":return i(()=>import("./InputType.abbc9e84.js"),["assets/InputType.abbc9e84.js","assets/vendor.e9042f2c.js"]);case"./types/NumberType.vue":return i(()=>import("./NumberType.bae67e72.js"),["assets/NumberType.bae67e72.js","assets/vendor.e9042f2c.js"]);case"./types/PhoneType.vue":return i(()=>import("./PhoneType.f1778217.js"),["assets/PhoneType.f1778217.js","assets/vendor.e9042f2c.js"]);case"./types/SwitchType.vue":return i(()=>import("./SwitchType.56df61e7.js"),["assets/SwitchType.56df61e7.js","assets/vendor.e9042f2c.js"]);case"./types/TextAreaType.vue":return i(()=>import("./TextAreaType.a1bccab5.js"),["assets/TextAreaType.a1bccab5.js","assets/vendor.e9042f2c.js"]);case"./types/TimeType.vue":return i(()=>import("./TimeType.82e5beb3.js"),["assets/TimeType.82e5beb3.js","assets/vendor.e9042f2c.js"]);case"./types/UrlType.vue":return i(()=>import("./UrlType.803fb838.js"),["assets/UrlType.803fb838.js","assets/vendor.e9042f2c.js"]);default:return new Promise(function(t,r){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(r.bind(null,new Error("Unknown variable dynamic import: "+e)))})}}const M={props:{field:{type:Object,required:!0},customFieldScope:{type:String,required:!0},index:{type:Number,required:!0},store:{type:Object,required:!0},storeProp:{type:String,required:!0}},setup(e){const t=e,{t:r}=w(),d={value:{required:V.withMessage(r("validation.required"),j(t.field.is_required))}},a=F(d,T(()=>t.field),{$scope:t.customFieldScope}),o=T(()=>t.field.type?L(()=>$(`./types/${t.field.type}Type.vue`)):!1);return(u,s)=>{const l=E("BaseInputGroup");return n(),m(l,{label:e.field.label,required:!!e.field.is_required,error:c(a).value.$error&&c(a).value.$errors[0].$message},{default:P(()=>[(n(),m(A(c(o)),{modelValue:e.field.value,"onUpdate:modelValue":s[0]||(s[0]=p=>e.field.value=p),options:e.field.options,invalid:c(a).value.$error,placeholder:e.field.placeholder},null,8,["modelValue","options","invalid","placeholder"]))]),_:1},8,["label","required","error"])}}},H={key:0},J={props:{store:{type:Object,required:!0},storeProp:{type:String,required:!0},isEdit:{type:Boolean,default:!1},type:{type:String,default:null},gridLayout:{type:String,default:"two-column"},isLoading:{type:Boolean,default:null},customFieldScope:{type:String,required:!0}},setup(e){const t=e,r=Y();a();function d(){t.isEdit&&t.store[t.storeProp].fields.forEach(o=>{const u=t.store[t.storeProp].customFields.findIndex(s=>s.id===o.custom_field_id);if(u>-1){let s=o.default_answer;s&&o.custom_field.type==="DateTime"&&(s=C(o.default_answer,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm")),t.store[t.storeProp].customFields[u]=v(_({},o),{id:o.custom_field_id,value:s,label:o.custom_field.label,options:o.custom_field.options,is_required:o.custom_field.is_required,placeholder:o.custom_field.placeholder,order:o.custom_field.order})}})}async function a(){let u=(await r.fetchCustomFields({type:t.type,limit:"all"})).data.data;u.map(s=>s.value=s.default_answer),t.store[t.storeProp].customFields=S.sortBy(u,s=>s.order),d()}return x(()=>t.store[t.storeProp].fields,o=>{d()}),(o,u)=>{const s=E("BaseInputGrid");return e.store[e.storeProp]&&e.store[e.storeProp].customFields.length>0&&!e.isLoading?(n(),b("div",H,[O(s,{layout:e.gridLayout},{default:P(()=>[(n(!0),b(R,null,k(e.store[e.storeProp].customFields,(l,p)=>(n(),m(M,{key:l.id,"custom-field-scope":e.customFieldScope,store:e.store,"store-prop":e.storeProp,index:p,field:l},null,8,["custom-field-scope","store","store-prop","index","field"]))),128))]),_:1},8,["layout"])])):B("",!0)}}};export{J as _};

View File

@ -1 +1 @@
import{k as C,u as S,i as b,d as x,e as g}from"./main.d8ec3f25.js";import{g as E,u as T,C as $,am as j,r as i,o as a,s,w as t,y as e,b as n,v as f,x as p,A as y}from"./vendor.e9042f2c.js";const V={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(l){const w=l,_=C();S();const D=b(),m=x(),{t:u}=E(),h=T();$(),j("utils");function B(r){D.openDialog({title:u("general.are_you_sure"),message:u("customers.confirm_delete",1),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(c=>{c&&_.deleteCustomer({ids:[r]}).then(o=>{if(o.data.success)return w.loadData&&w.loadData(),!0})})}return(r,c)=>{const o=i("BaseIcon"),k=i("BaseButton"),d=i("BaseDropdownItem"),v=i("router-link"),I=i("BaseDropdown");return a(),s(I,{"content-loading":e(_).isFetchingViewData},{activator:t(()=>[e(h).name==="customers.view"?(a(),s(k,{key:0,variant:"primary"},{default:t(()=>[n(o,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),s(o,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[e(m).hasAbilities(e(g).EDIT_CUSTOMER)?(a(),s(v,{key:0,to:`/admin/customers/${l.row.id}/edit`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),f(" "+p(r.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(h).name!=="customers.view"&&e(m).hasAbilities(e(g).VIEW_CUSTOMER)?(a(),s(v,{key:1,to:`customers/${l.row.id}/view`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),f(" "+p(r.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(m).hasAbilities(e(g).DELETE_CUSTOMER)?(a(),s(d,{key:2,onClick:c[0]||(c[0]=N=>B(l.row.id))},{default:t(()=>[n(o,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),f(" "+p(r.$t("general.delete")),1)]),_:1})):y("",!0)]),_:1},8,["content-loading"])}}};export{V as _};
import{k as C,u as S,i as b,d as x,e as g}from"./main.9d655092.js";import{g as E,u as T,C as $,am as j,r as i,o as a,s,w as t,y as e,b as n,v as p,x as f,A as y}from"./vendor.e9042f2c.js";const V={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(l){const w=l,_=C();S();const D=b(),m=x(),{t:u}=E(),h=T();$(),j("utils");function B(r){D.openDialog({title:u("general.are_you_sure"),message:u("customers.confirm_delete",1),yesLabel:u("general.ok"),noLabel:u("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(c=>{c&&_.deleteCustomer({ids:[r]}).then(o=>{if(o.data.success)return w.loadData&&w.loadData(),!0})})}return(r,c)=>{const o=i("BaseIcon"),k=i("BaseButton"),d=i("BaseDropdownItem"),v=i("router-link"),I=i("BaseDropdown");return a(),s(I,{"content-loading":e(_).isFetchingViewData},{activator:t(()=>[e(h).name==="customers.view"?(a(),s(k,{key:0,variant:"primary"},{default:t(()=>[n(o,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),s(o,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[e(m).hasAbilities(e(g).EDIT_CUSTOMER)?(a(),s(v,{key:0,to:`/admin/customers/${l.row.id}/edit`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(h).name!=="customers.view"&&e(m).hasAbilities(e(g).VIEW_CUSTOMER)?(a(),s(v,{key:1,to:`customers/${l.row.id}/view`},{default:t(()=>[n(d,null,{default:t(()=>[n(o,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):y("",!0),e(m).hasAbilities(e(g).DELETE_CUSTOMER)?(a(),s(d,{key:2,onClick:c[0]||(c[0]=N=>B(l.row.id))},{default:t(()=>[n(o,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+f(r.$t("general.delete")),1)]),_:1})):y("",!0)]),_:1},8,["content-loading"])}}};export{V as _};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import{aW as $r,aX as Br,aR as Kr,aY as Hr,o as Wr,c as Xr,t as Yr}from"./vendor.e9042f2c.js";import{_ as Vr}from"./main.d8ec3f25.js";var gr={exports:{}};/**!
import{aW as $r,aX as Br,aR as Kr,aY as Hr,o as Wr,c as Xr,t as Yr}from"./vendor.e9042f2c.js";import{_ as Vr}from"./main.9d655092.js";var gr={exports:{}};/**!
* Sortable 1.14.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>

View File

@ -0,0 +1 @@
import{m as D,c as _,t as j}from"./main.9d655092.js";import{i as p,k as u,D as l,b3 as A,r as d,ap as F,y as o,o as x,s as N,w as m,c as G,Z as z,b as v,z as L,A as C,t as E,x as b}from"./vendor.e9042f2c.js";const O={key:0},U={class:"text-gray-500 sm:text-sm"},q={class:"text-gray-400 text-xs mt-2 font-light"},J={props:{v:{type:Object,default:null},isLoading:{type:Boolean,default:!1},store:{type:Object,default:null},storeProp:{type:String,default:""},isEdit:{type:Boolean,default:!1},customerCurrency:{type:[String,Number],default:null}},setup(r){const e=r,h=D(),B=_(),g=j(),f=p(!1);let a=p(!1);h.fetchCurrencies();const s=u(()=>B.selectedCompanyCurrency),c=u(()=>h.currencies.find(t=>t.id===e.store[e.storeProp].currency_id)),P=u(()=>s.value.id!==e.customerCurrency);l(()=>e.store[e.storeProp].customer,t=>{R(t)},{deep:!0}),l(()=>e.store[e.storeProp].currency_id,t=>{$(t)},{immediate:!0}),l(()=>e.customerCurrency,t=>{t&&e.isEdit&&w()},{immediate:!0});function w(){P.value&&g.checkForActiveProvider(e.customerCurrency).then(t=>{t.data.success&&(f.value=!0)})}function R(t){t?e.store[e.storeProp].currency_id=t.currency.id:e.store[e.storeProp].currency_id=s.value.id}async function $(t){t!==s.value.id?(!e.isEdit&&t&&await y(t),e.store.showExchangeRate=!0):e.store.showExchangeRate=!1}function y(t){a.value=!0,g.getCurrentExchangeRate(t).then(n=>{n.data&&!n.data.error?e.store[e.storeProp].exchange_rate=n.data.exchangeRate[0]:e.store[e.storeProp].exchange_rate="",a.value=!1}).catch(n=>{a.value=!1})}return A(()=>{e.store.showExchangeRate=!1}),(t,n)=>{const k=d("BaseIcon"),S=d("BaseInput"),I=d("BaseInputGroup"),V=F("tooltip");return r.store.showExchangeRate&&o(c)?(x(),N(I,{key:0,"content-loading":o(a)&&!r.isEdit,label:t.$t("settings.exchange_rate.exchange_rate"),error:r.v.exchange_rate.$error&&r.v.exchange_rate.$errors[0].$message,required:""},{labelRight:m(()=>[f.value&&r.isEdit?(x(),G("div",O,[z(v(k,{name:"RefreshIcon",class:L(`h-4 w-4 text-primary-500 cursor-pointer outline-none ${o(a)?" animate-spin transform rotate-180 cursor-not-allowed pointer-events-none ":""}`),onClick:n[0]||(n[0]=i=>y(r.customerCurrency))},null,8,["class"]),[[V,{content:"Fetch Latest Exchange rate"}]])])):C("",!0)]),default:m(()=>[v(S,{modelValue:r.store[r.storeProp].exchange_rate,"onUpdate:modelValue":n[1]||(n[1]=i=>r.store[r.storeProp].exchange_rate=i),"content-loading":o(a)&&!r.isEdit,addon:`1 ${o(c).code} =`,disabled:o(a),onInput:n[2]||(n[2]=i=>r.v.exchange_rate.$touch())},{right:m(()=>[E("span",U,b(o(s).code),1)]),_:1},8,["modelValue","content-loading","addon","disabled"]),E("span",q,b(t.$t("settings.exchange_rate.exchange_help_text",{currency:o(c).code,baseCurrency:o(s).code})),1)]),_:1},8,["content-loading","label","error"])):C("",!0)}}};export{J as _};

View File

@ -1 +0,0 @@
import{m as D,c as _,t as j}from"./main.d8ec3f25.js";import{i as p,k as u,D as l,r as d,ap as A,y as o,o as x,s as F,w as g,c as N,Z as G,b as v,z,A as C,t as E,x as P}from"./vendor.e9042f2c.js";const L={key:0},O={class:"text-gray-500 sm:text-sm"},q={class:"text-gray-400 text-xs mt-2 font-light"},H={props:{v:{type:Object,default:null},isLoading:{type:Boolean,default:!1},store:{type:Object,default:null},storeProp:{type:String,default:""},isEdit:{type:Boolean,default:!1},customerCurrency:{type:[String,Number],default:null}},setup(r){const e=r,h=D(),b=_(),m=j(),f=p(!1);let a=p(!1);h.fetchCurrencies();const s=u(()=>b.selectedCompanyCurrency),c=u(()=>h.currencies.find(t=>t.id===e.store[e.storeProp].currency_id)),B=u(()=>s.value.id!==e.customerCurrency);l(()=>e.store[e.storeProp].customer,t=>{R(t)},{deep:!0}),l(()=>e.store[e.storeProp].currency_id,t=>{$(t)}),l(()=>e.customerCurrency,t=>{t&&e.isEdit&&w()},{immediate:!0});function w(){B.value&&m.checkForActiveProvider(e.customerCurrency).then(t=>{t.data.success&&(f.value=!0)})}function R(t){t?e.store[e.storeProp].currency_id=t.currency.id:e.store[e.storeProp].currency_id=s.value.id}async function $(t){t!==s.value.id?(e.isEdit||await y(t),e.store.showExchangeRate=!0):e.store.showExchangeRate=!1}function y(t){a.value=!0,m.getCurrentExchangeRate(t).then(n=>{n.data&&!n.data.error?e.store[e.storeProp].exchange_rate=n.data.exchangeRate[0]:e.store[e.storeProp].exchange_rate="",a.value=!1}).catch(n=>{a.value=!1})}return(t,n)=>{const k=d("BaseIcon"),S=d("BaseInput"),I=d("BaseInputGroup"),V=A("tooltip");return r.store.showExchangeRate&&o(c)?(x(),F(I,{key:0,"content-loading":o(a)&&!r.isEdit,label:t.$t("settings.exchange_rate.exchange_rate"),error:r.v.exchange_rate.$error&&r.v.exchange_rate.$errors[0].$message,required:""},{labelRight:g(()=>[f.value&&r.isEdit?(x(),N("div",L,[G(v(k,{name:"RefreshIcon",class:z(`h-4 w-4 text-primary-500 cursor-pointer outline-none ${o(a)?" animate-spin transform rotate-180 cursor-not-allowed pointer-events-none ":""}`),onClick:n[0]||(n[0]=i=>y(r.customerCurrency))},null,8,["class"]),[[V,{content:"Fetch Latest Exchange rate"}]])])):C("",!0)]),default:g(()=>[v(S,{modelValue:r.store[r.storeProp].exchange_rate,"onUpdate:modelValue":n[1]||(n[1]=i=>r.store[r.storeProp].exchange_rate=i),"content-loading":o(a)&&!r.isEdit,addon:`1 ${o(c).code} =`,disabled:o(a),onInput:n[2]||(n[2]=i=>r.v.exchange_rate.$touch())},{right:g(()=>[E("span",O,P(o(s).code),1)]),_:1},8,["modelValue","content-loading","addon","disabled"]),E("span",q,P(t.$t("settings.exchange_rate.exchange_help_text",{currency:o(c).code,baseCurrency:o(s).code})),1)]),_:1},8,["content-loading","label","error"])):C("",!0)}}};export{H as _};

View File

@ -1 +1 @@
import{i as w,u as z,s as S,d as M,g as k,e as E}from"./main.d8ec3f25.js";import{g as I,u as T,am as j,r as i,o as m,s as p,w as e,y as g,b as n,v,x as C,A as N,i as P,k as F,c as V,z as A,t as $,F as L}from"./vendor.e9042f2c.js";import{_ as H}from"./CategoryModal.733ef7b0.js";const O={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(y){const d=y,B=w();z();const{t:o}=I(),s=S(),x=T(),_=M(),h=k();j("utils");function b(l){s.fetchCategory(l),h.openModal({title:o("settings.expense_category.edit_category"),componentName:"CategoryModal",refreshData:d.loadData,size:"sm"})}function r(l){B.openDialog({title:o("general.are_you_sure"),message:o("settings.expense_category.confirm_delete"),yesLabel:o("general.ok"),noLabel:o("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async()=>{if((await s.deleteCategory(l)).data.success)return d.loadData&&d.loadData(),!0;d.loadData&&d.loadData()})}return(l,t)=>{const c=i("BaseIcon"),u=i("BaseButton"),f=i("BaseDropdownItem"),a=i("BaseDropdown");return m(),p(a,null,{activator:e(()=>[g(x).name==="expenseCategorys.view"?(m(),p(u,{key:0,variant:"primary"},{default:e(()=>[n(c,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(m(),p(c,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:e(()=>[g(_).hasAbilities(g(E).EDIT_EXPENSE)?(m(),p(f,{key:0,onClick:t[0]||(t[0]=D=>b(y.row.id))},{default:e(()=>[n(c,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),v(" "+C(l.$t("general.edit")),1)]),_:1})):N("",!0),g(_).hasAbilities(g(E).DELETE_EXPENSE)?(m(),p(f,{key:1,onClick:t[1]||(t[1]=D=>r(y.row.id))},{default:e(()=>[n(c,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),v(" "+C(l.$t("general.delete")),1)]),_:1})):N("",!0)]),_:1})}}},X={class:"w-64"},R={class:"truncate"},J={setup(y){const d=S();w();const B=k(),{t:o}=I(),s=P(null),x=F(()=>[{key:"name",label:o("settings.expense_category.category_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"description",label:o("settings.expense_category.category_description"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function _({page:r,filter:l,sort:t}){let c={orderByField:t.fieldName||"created_at",orderBy:t.order||"desc",page:r},u=await d.fetchCategories(c);return{data:u.data.data,pagination:{totalPages:u.data.meta.last_page,currentPage:r,totalCount:u.data.meta.total,limit:5}}}function h(){B.openModal({title:o("settings.expense_category.add_category"),componentName:"CategoryModal",size:"sm",refreshData:s.value&&s.value.refresh})}async function b(){s.value&&s.value.refresh()}return(r,l)=>{const t=i("BaseIcon"),c=i("BaseButton"),u=i("BaseTable"),f=i("BaseSettingCard");return m(),V(L,null,[n(H),n(f,{title:r.$t("settings.expense_category.title"),description:r.$t("settings.expense_category.description")},{action:e(()=>[n(c,{variant:"primary-outline",type:"button",onClick:h},{left:e(a=>[n(t,{class:A(a.class),name:"PlusIcon"},null,8,["class"])]),default:e(()=>[v(" "+C(r.$t("settings.expense_category.add_new_category")),1)]),_:1})]),default:e(()=>[n(u,{ref:(a,D)=>{D.table=a,s.value=a},data:_,columns:g(x),class:"mt-16"},{"cell-description":e(({row:a})=>[$("div",X,[$("p",R,C(a.data.description),1)])]),"cell-actions":e(({row:a})=>[n(O,{row:a.data,table:s.value,"load-data":b},null,8,["row","table"])]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{J as default};
import{i as w,u as z,s as S,d as M,g as k,e as E}from"./main.9d655092.js";import{g as I,u as T,am as j,r as i,o as m,s as p,w as e,y as g,b as n,v,x as C,A as N,i as P,k as F,c as V,z as A,t as $,F as L}from"./vendor.e9042f2c.js";import{_ as H}from"./CategoryModal.46b61f9f.js";const O={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(y){const d=y,B=w();z();const{t:o}=I(),s=S(),x=T(),_=M(),h=k();j("utils");function b(l){s.fetchCategory(l),h.openModal({title:o("settings.expense_category.edit_category"),componentName:"CategoryModal",refreshData:d.loadData,size:"sm"})}function r(l){B.openDialog({title:o("general.are_you_sure"),message:o("settings.expense_category.confirm_delete"),yesLabel:o("general.ok"),noLabel:o("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async()=>{if((await s.deleteCategory(l)).data.success)return d.loadData&&d.loadData(),!0;d.loadData&&d.loadData()})}return(l,t)=>{const c=i("BaseIcon"),u=i("BaseButton"),f=i("BaseDropdownItem"),a=i("BaseDropdown");return m(),p(a,null,{activator:e(()=>[g(x).name==="expenseCategorys.view"?(m(),p(u,{key:0,variant:"primary"},{default:e(()=>[n(c,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(m(),p(c,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:e(()=>[g(_).hasAbilities(g(E).EDIT_EXPENSE)?(m(),p(f,{key:0,onClick:t[0]||(t[0]=D=>b(y.row.id))},{default:e(()=>[n(c,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),v(" "+C(l.$t("general.edit")),1)]),_:1})):N("",!0),g(_).hasAbilities(g(E).DELETE_EXPENSE)?(m(),p(f,{key:1,onClick:t[1]||(t[1]=D=>r(y.row.id))},{default:e(()=>[n(c,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),v(" "+C(l.$t("general.delete")),1)]),_:1})):N("",!0)]),_:1})}}},X={class:"w-64"},R={class:"truncate"},J={setup(y){const d=S();w();const B=k(),{t:o}=I(),s=P(null),x=F(()=>[{key:"name",label:o("settings.expense_category.category_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"description",label:o("settings.expense_category.category_description"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function _({page:r,filter:l,sort:t}){let c={orderByField:t.fieldName||"created_at",orderBy:t.order||"desc",page:r},u=await d.fetchCategories(c);return{data:u.data.data,pagination:{totalPages:u.data.meta.last_page,currentPage:r,totalCount:u.data.meta.total,limit:5}}}function h(){B.openModal({title:o("settings.expense_category.add_category"),componentName:"CategoryModal",size:"sm",refreshData:s.value&&s.value.refresh})}async function b(){s.value&&s.value.refresh()}return(r,l)=>{const t=i("BaseIcon"),c=i("BaseButton"),u=i("BaseTable"),f=i("BaseSettingCard");return m(),V(L,null,[n(H),n(f,{title:r.$t("settings.expense_category.title"),description:r.$t("settings.expense_category.description")},{action:e(()=>[n(c,{variant:"primary-outline",type:"button",onClick:h},{left:e(a=>[n(t,{class:A(a.class),name:"PlusIcon"},null,8,["class"])]),default:e(()=>[v(" "+C(r.$t("settings.expense_category.add_new_category")),1)]),_:1})]),default:e(()=>[n(u,{ref:(a,D)=>{D.table=a,s.value=a},data:_,columns:g(x),class:"mt-16"},{"cell-description":e(({row:a})=>[$("div",X,[$("p",R,C(a.data.description),1)])]),"cell-actions":e(({row:a})=>[n(O,{row:a.data,table:s.value,"load-data":b},null,8,["row","table"])]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{J as default};

View File

@ -1 +1 @@
import{g as w,j as S,i as f,m as _,n as V,a2 as x,q as I,r as n,o as l,c as u,b as r,w as m,y as t,x as d,t as q,v as N,B as M,a as j}from"./vendor.e9042f2c.js";import{u as C,h as D}from"./main.d8ec3f25.js";const E=["onSubmit"],G={key:0},F={key:1},L={class:"mt-4 mb-4 text-sm"},A={setup(T){const g=C(),{t:c}=w(),i=S({email:""}),p=f(!1),o=f(!1),y={email:{required:_.withMessage(c("validation.required"),V),email:_.withMessage(c("validation.email_incorrect"),x)}},a=I(y,i);async function h(s){if(a.value.$touch(),!a.value.$invalid)try{o.value=!0,(await j.post("/api/v1/auth/password/email",i)).data&&g.showNotification({type:"success",message:"Mail sent successfully"}),p.value=!0,o.value=!1}catch(e){D(e),o.value=!1}}return(s,e)=>{const $=n("BaseInput"),b=n("BaseInputGroup"),B=n("BaseButton"),k=n("router-link");return l(),u("form",{id:"loginForm",onSubmit:M(h,["prevent"])},[r(b,{error:t(a).email.$error&&t(a).email.$errors[0].$message,label:s.$t("login.enter_email"),class:"mb-4",required:""},{default:m(()=>[r($,{modelValue:t(i).email,"onUpdate:modelValue":e[0]||(e[0]=v=>t(i).email=v),invalid:t(a).email.$error,focus:"",type:"email",name:"email",onInput:e[1]||(e[1]=v=>t(a).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),r(B,{loading:o.value,disabled:o.value,type:"submit",variant:"primary"},{default:m(()=>[p.value?(l(),u("div",F,d(s.$t("validation.not_yet")),1)):(l(),u("div",G,d(s.$t("validation.send_reset_link")),1))]),_:1},8,["loading","disabled"]),q("div",L,[r(k,{to:"/login",class:"text-sm text-primary-400 hover:text-gray-700"},{default:m(()=>[N(d(s.$t("general.back_to_login")),1)]),_:1})])],40,E)}}};export{A as default};
import{g as w,j as S,i as _,m as f,n as V,a2 as x,q as I,r as n,o as l,c as u,b as r,w as m,y as t,x as d,t as q,v as N,B as M,a as j}from"./vendor.e9042f2c.js";import{u as C,h as D}from"./main.9d655092.js";const E=["onSubmit"],G={key:0},F={key:1},L={class:"mt-4 mb-4 text-sm"},A={setup(T){const g=C(),{t:c}=w(),i=S({email:""}),p=_(!1),o=_(!1),y={email:{required:f.withMessage(c("validation.required"),V),email:f.withMessage(c("validation.email_incorrect"),x)}},a=I(y,i);async function h(s){if(a.value.$touch(),!a.value.$invalid)try{o.value=!0,(await j.post("/api/v1/auth/password/email",i)).data&&g.showNotification({type:"success",message:"Mail sent successfully"}),p.value=!0,o.value=!1}catch(e){D(e),o.value=!1}}return(s,e)=>{const $=n("BaseInput"),b=n("BaseInputGroup"),B=n("BaseButton"),k=n("router-link");return l(),u("form",{id:"loginForm",onSubmit:M(h,["prevent"])},[r(b,{error:t(a).email.$error&&t(a).email.$errors[0].$message,label:s.$t("login.enter_email"),class:"mb-4",required:""},{default:m(()=>[r($,{modelValue:t(i).email,"onUpdate:modelValue":e[0]||(e[0]=v=>t(i).email=v),invalid:t(a).email.$error,focus:"",type:"email",name:"email",onInput:e[1]||(e[1]=v=>t(a).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),r(B,{loading:o.value,disabled:o.value,type:"submit",variant:"primary"},{default:m(()=>[p.value?(l(),u("div",F,d(s.$t("validation.not_yet")),1)):(l(),u("div",G,d(s.$t("validation.send_reset_link")),1))]),_:1},8,["loading","disabled"]),q("div",L,[r(k,{to:"/login",class:"text-sm text-primary-400 hover:text-gray-700"},{default:m(()=>[N(d(s.$t("general.back_to_login")),1)]),_:1})])],40,E)}}};export{A as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{g as O,u as j,C as z,am as R,r as h,o as r,s as l,w as o,y as c,b as s,Z as M,al as P,v as d,x as v,A as m}from"./vendor.e9042f2c.js";import{f as F,g as U,u as H,i as W,d as q,e as f}from"./main.d8ec3f25.js";const J={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(a){const w=a,p=F(),$=U(),N=H(),b=W(),g=q(),{t:i}=O(),y=j(),S=z(),x=R("utils");function _(e){return(e.status=="SENT"||e.status=="VIEWED")&&y.name!=="invoices.view"&&g.hasAbilities(f.SEND_INVOICE)}function D(e){return e.status=="DRAFT"&&y.name!=="invoices.view"&&g.hasAbilities(f.SEND_INVOICE)}async function B(e){b.openDialog({title:i("general.are_you_sure"),message:i("invoices.confirm_delete"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(n=>{e=e,n&&p.deleteInvoice({ids:[e]}).then(t=>{t.data.success&&(S.push("/admin/invoices"),w.table&&w.table.refresh(),p.$patch(I=>{I.selectedInvoices=[],I.selectAllField=!1}))})})}async function A(e){b.openDialog({title:i("general.are_you_sure"),message:i("invoices.confirm_clone"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"primary",hideNoButton:!1,size:"lg"}).then(n=>{n&&p.cloneInvoice(e).then(t=>{S.push(`/admin/invoices/${t.data.data.id}/edit`)})})}async function T(e){b.openDialog({title:i("general.are_you_sure"),message:i("invoices.invoice_mark_as_sent"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"primary",hideNoButton:!1,size:"lg"}).then(n=>{const t={id:e,status:"SENT"};n&&p.markAsSent(t).then(I=>{w.table&&w.table.refresh()})})}async function E(e){$.openModal({title:i("invoices.send_invoice"),componentName:"SendInvoiceModal",id:e.id,data:e,variant:"sm"})}function V(){let e=`${window.location.origin}/invoices/pdf/${w.row.unique_hash}`;x.copyTextToClipboard(e),N.showNotification({type:"success",message:i("general.copied_pdf_url_clipboard")})}return(e,n)=>{const t=h("BaseIcon"),I=h("BaseButton"),u=h("BaseDropdownItem"),C=h("router-link"),L=h("BaseDropdown");return r(),l(L,null,{activator:o(()=>[c(y).name==="invoices.view"?(r(),l(I,{key:0,variant:"primary"},{default:o(()=>[s(t,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(r(),l(t,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:o(()=>[c(g).hasAbilities(c(f).EDIT_INVOICE)?(r(),l(C,{key:0,to:`/admin/invoices/${a.row.id}/edit`},{default:o(()=>[M(s(u,null,{default:o(()=>[s(t,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.edit")),1)]),_:1},512),[[P,a.row.allow_edit]])]),_:1},8,["to"])):m("",!0),c(y).name==="invoices.view"?(r(),l(u,{key:1,onClick:V},{default:o(()=>[s(t,{name:"LinkIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.copy_pdf_url")),1)]),_:1})):m("",!0),c(y).name!=="invoices.view"&&c(g).hasAbilities(c(f).VIEW_INVOICE)?(r(),l(C,{key:2,to:`invoices/${a.row.id}/view`},{default:o(()=>[s(u,null,{default:o(()=>[s(t,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):m("",!0),D(a.row)?(r(),l(u,{key:3,onClick:n[0]||(n[0]=k=>E(a.row))},{default:o(()=>[s(t,{name:"PaperAirplaneIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.send_invoice")),1)]),_:1})):m("",!0),_(a.row)?(r(),l(u,{key:4,onClick:n[1]||(n[1]=k=>E(a.row))},{default:o(()=>[s(t,{name:"PaperAirplaneIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.resend_invoice")),1)]),_:1})):m("",!0),s(C,{to:`/admin/payments/${a.row.id}/create`},{default:o(()=>[a.row.status=="SENT"&&c(y).name!=="invoices.view"?(r(),l(u,{key:0},{default:o(()=>[s(t,{name:"CreditCardIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.record_payment")),1)]),_:1})):m("",!0)]),_:1},8,["to"]),D(a.row)?(r(),l(u,{key:5,onClick:n[2]||(n[2]=k=>T(a.row.id))},{default:o(()=>[s(t,{name:"CheckCircleIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.mark_as_sent")),1)]),_:1})):m("",!0),c(g).hasAbilities(c(f).CREATE_INVOICE)?(r(),l(u,{key:6,onClick:n[3]||(n[3]=k=>A(a.row))},{default:o(()=>[s(t,{name:"DocumentTextIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.clone_invoice")),1)]),_:1})):m("",!0),c(g).hasAbilities(c(f).DELETE_INVOICE)?(r(),l(u,{key:7,onClick:n[4]||(n[4]=k=>B(a.row.id))},{default:o(()=>[s(t,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.delete")),1)]),_:1})):m("",!0)]),_:1})}}};export{J as _};
import{g as O,u as j,C as z,am as R,r as h,o as r,s as l,w as o,y as c,b as s,Z as M,al as P,v as d,x as v,A as m}from"./vendor.e9042f2c.js";import{f as F,g as U,u as H,i as W,d as q,e as f}from"./main.9d655092.js";const J={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(a){const w=a,p=F(),$=U(),N=H(),b=W(),g=q(),{t:i}=O(),y=j(),S=z(),x=R("utils");function _(e){return(e.status=="SENT"||e.status=="VIEWED")&&y.name!=="invoices.view"&&g.hasAbilities(f.SEND_INVOICE)}function D(e){return e.status=="DRAFT"&&y.name!=="invoices.view"&&g.hasAbilities(f.SEND_INVOICE)}async function B(e){b.openDialog({title:i("general.are_you_sure"),message:i("invoices.confirm_delete"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(n=>{e=e,n&&p.deleteInvoice({ids:[e]}).then(t=>{t.data.success&&(S.push("/admin/invoices"),w.table&&w.table.refresh(),p.$patch(I=>{I.selectedInvoices=[],I.selectAllField=!1}))})})}async function A(e){b.openDialog({title:i("general.are_you_sure"),message:i("invoices.confirm_clone"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"primary",hideNoButton:!1,size:"lg"}).then(n=>{n&&p.cloneInvoice(e).then(t=>{S.push(`/admin/invoices/${t.data.data.id}/edit`)})})}async function T(e){b.openDialog({title:i("general.are_you_sure"),message:i("invoices.invoice_mark_as_sent"),yesLabel:i("general.ok"),noLabel:i("general.cancel"),variant:"primary",hideNoButton:!1,size:"lg"}).then(n=>{const t={id:e,status:"SENT"};n&&p.markAsSent(t).then(I=>{w.table&&w.table.refresh()})})}async function E(e){$.openModal({title:i("invoices.send_invoice"),componentName:"SendInvoiceModal",id:e.id,data:e,variant:"sm"})}function V(){let e=`${window.location.origin}/invoices/pdf/${w.row.unique_hash}`;x.copyTextToClipboard(e),N.showNotification({type:"success",message:i("general.copied_pdf_url_clipboard")})}return(e,n)=>{const t=h("BaseIcon"),I=h("BaseButton"),u=h("BaseDropdownItem"),C=h("router-link"),L=h("BaseDropdown");return r(),l(L,null,{activator:o(()=>[c(y).name==="invoices.view"?(r(),l(I,{key:0,variant:"primary"},{default:o(()=>[s(t,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(r(),l(t,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:o(()=>[c(g).hasAbilities(c(f).EDIT_INVOICE)?(r(),l(C,{key:0,to:`/admin/invoices/${a.row.id}/edit`},{default:o(()=>[M(s(u,null,{default:o(()=>[s(t,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.edit")),1)]),_:1},512),[[P,a.row.allow_edit]])]),_:1},8,["to"])):m("",!0),c(y).name==="invoices.view"?(r(),l(u,{key:1,onClick:V},{default:o(()=>[s(t,{name:"LinkIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.copy_pdf_url")),1)]),_:1})):m("",!0),c(y).name!=="invoices.view"&&c(g).hasAbilities(c(f).VIEW_INVOICE)?(r(),l(C,{key:2,to:`invoices/${a.row.id}/view`},{default:o(()=>[s(u,null,{default:o(()=>[s(t,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):m("",!0),D(a.row)?(r(),l(u,{key:3,onClick:n[0]||(n[0]=k=>E(a.row))},{default:o(()=>[s(t,{name:"PaperAirplaneIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.send_invoice")),1)]),_:1})):m("",!0),_(a.row)?(r(),l(u,{key:4,onClick:n[1]||(n[1]=k=>E(a.row))},{default:o(()=>[s(t,{name:"PaperAirplaneIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.resend_invoice")),1)]),_:1})):m("",!0),s(C,{to:`/admin/payments/${a.row.id}/create`},{default:o(()=>[a.row.status=="SENT"&&c(y).name!=="invoices.view"?(r(),l(u,{key:0},{default:o(()=>[s(t,{name:"CreditCardIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.record_payment")),1)]),_:1})):m("",!0)]),_:1},8,["to"]),D(a.row)?(r(),l(u,{key:5,onClick:n[2]||(n[2]=k=>T(a.row.id))},{default:o(()=>[s(t,{name:"CheckCircleIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.mark_as_sent")),1)]),_:1})):m("",!0),c(g).hasAbilities(c(f).CREATE_INVOICE)?(r(),l(u,{key:6,onClick:n[3]||(n[3]=k=>A(a.row))},{default:o(()=>[s(t,{name:"DocumentTextIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("invoices.clone_invoice")),1)]),_:1})):m("",!0),c(g).hasAbilities(c(f).DELETE_INVOICE)?(r(),l(u,{key:7,onClick:n[4]||(n[4]=k=>B(a.row.id))},{default:o(()=>[s(t,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),d(" "+v(e.$t("general.delete")),1)]),_:1})):m("",!0)]),_:1})}}};export{J as _};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{g as S,i as V,k as g,m as h,n as C,p as k,q as x,r as i,o as b,s as B,w as r,t as d,v as p,x as f,y as e,b as l,z as q,A as z,B as N}from"./vendor.e9042f2c.js";import{p as j,g as D}from"./main.d8ec3f25.js";const E={class:"flex justify-between w-full"},G=["onSubmit"],L={class:"p-8 sm:p-6"},T={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},H={setup(A){const t=j(),a=D(),{t:v}=S();let o=V(!1);const $=g(()=>({name:{required:h.withMessage(v("validation.required"),C),minLength:h.withMessage(v("validation.name_min_length",{count:3}),k(3))}})),n=x($,g(()=>t.currentItemUnit));async function y(){if(n.value.$touch(),n.value.$invalid)return!0;try{const s=t.isItemUnitEdit?t.updateItemUnit:t.addItemUnit;o.value=!0,await s(t.currentItemUnit),a.refreshData&&a.refreshData(),u(),o.value=!1}catch{return o.value=!1,!0}}function u(){a.closeModal(),setTimeout(()=>{t.currentItemUnit={id:null,name:""},a.$reset(),n.value.$reset()},300)}return(s,m)=>{const _=i("BaseIcon"),U=i("BaseInput"),w=i("BaseInputGroup"),I=i("BaseButton"),M=i("BaseModal");return b(),B(M,{show:e(a).active&&e(a).componentName==="ItemUnitModal",onClose:u},{header:r(()=>[d("div",E,[p(f(e(a).title)+" ",1),l(_,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:u})])]),default:r(()=>[d("form",{action:"",onSubmit:N(y,["prevent"])},[d("div",L,[l(w,{label:s.$t("settings.customization.items.unit_name"),error:e(n).name.$error&&e(n).name.$errors[0].$message,variant:"horizontal",required:""},{default:r(()=>[l(U,{modelValue:e(t).currentItemUnit.name,"onUpdate:modelValue":m[0]||(m[0]=c=>e(t).currentItemUnit.name=c),invalid:e(n).name.$error,type:"text",onInput:m[1]||(m[1]=c=>e(n).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),d("div",T,[l(I,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:u},{default:r(()=>[p(f(s.$t("general.cancel")),1)]),_:1}),l(I,{loading:e(o),disabled:e(o),variant:"primary",type:"submit"},{left:r(c=>[e(o)?z("",!0):(b(),B(_,{key:0,name:"SaveIcon",class:q(c.class)},null,8,["class"]))]),default:r(()=>[p(" "+f(e(t).isItemUnitEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,G)]),_:1},8,["show"])}}};export{H as _};
import{g as S,i as V,k as g,m as h,n as C,p as k,q as x,r as i,o as b,s as B,w as r,t as c,v as p,x as v,y as e,b as l,z as q,A as z,B as N}from"./vendor.e9042f2c.js";import{p as j,g as D}from"./main.9d655092.js";const E={class:"flex justify-between w-full"},G=["onSubmit"],L={class:"p-8 sm:p-6"},T={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid border-modal-bg"},H={setup(A){const t=j(),a=D(),{t:f}=S();let o=V(!1);const $=g(()=>({name:{required:h.withMessage(f("validation.required"),C),minLength:h.withMessage(f("validation.name_min_length",{count:3}),k(3))}})),n=x($,g(()=>t.currentItemUnit));async function y(){if(n.value.$touch(),n.value.$invalid)return!0;try{const s=t.isItemUnitEdit?t.updateItemUnit:t.addItemUnit;o.value=!0,await s(t.currentItemUnit),a.refreshData&&a.refreshData(),u(),o.value=!1}catch{return o.value=!1,!0}}function u(){a.closeModal(),setTimeout(()=>{t.currentItemUnit={id:null,name:""},a.$reset(),n.value.$reset()},300)}return(s,m)=>{const _=i("BaseIcon"),U=i("BaseInput"),w=i("BaseInputGroup"),I=i("BaseButton"),M=i("BaseModal");return b(),B(M,{show:e(a).active&&e(a).componentName==="ItemUnitModal",onClose:u},{header:r(()=>[c("div",E,[p(v(e(a).title)+" ",1),l(_,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:u})])]),default:r(()=>[c("form",{action:"",onSubmit:N(y,["prevent"])},[c("div",L,[l(w,{label:s.$t("settings.customization.items.unit_name"),error:e(n).name.$error&&e(n).name.$errors[0].$message,variant:"horizontal",required:""},{default:r(()=>[l(U,{modelValue:e(t).currentItemUnit.name,"onUpdate:modelValue":m[0]||(m[0]=d=>e(t).currentItemUnit.name=d),invalid:e(n).name.$error,type:"text",onInput:m[1]||(m[1]=d=>e(n).name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),c("div",T,[l(I,{type:"button",variant:"primary-outline",class:"mr-3 text-sm",onClick:u},{default:r(()=>[p(v(s.$t("general.cancel")),1)]),_:1}),l(I,{loading:e(o),disabled:e(o),variant:"primary",type:"submit"},{left:r(d=>[e(o)?z("",!0):(b(),B(_,{key:0,name:"SaveIcon",class:q(d.class)},null,8,["class"]))]),default:r(()=>[p(" "+v(e(t).isItemUnitEdit?s.$t("general.update"):s.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,G)]),_:1},8,["show"])}}};export{H as _};

View File

@ -0,0 +1 @@
import{N as t}from"./main.9d655092.js";import{r as s,o as r,c as a,b as e,t as c}from"./vendor.e9042f2c.js";const n={class:"h-screen h-screen-ios overflow-y-auto text-base"},i={class:"container mx-auto px-4"},u={setup(_){return(m,p)=>{const o=s("router-view");return r(),a("div",n,[e(t),c("div",i,[e(o)])])}}};export{u as default};

View File

@ -1 +0,0 @@
import{N as t}from"./main.d8ec3f25.js";import{r as s,o as r,c,b as e,t as a}from"./vendor.e9042f2c.js";const n={class:"h-screen h-screen-ios overflow-y-auto text-base"},i={class:"container mx-auto px-4"},l={setup(_){return(m,p)=>{const o=s("router-view");return r(),c("div",n,[e(t),a("div",i,[e(o)])])}}};export{l as default};

View File

@ -1,4 +1,4 @@
import{aR as Zi,am as Ji,i as Qi,k as eo,ac as to,M as ro,j as ea,o as ao,c as no,t as io}from"./vendor.e9042f2c.js";import{c as oo}from"./main.d8ec3f25.js";var ta={exports:{}};/*!
import{aR as Zi,am as Ji,i as Qi,k as eo,ac as to,M as ro,j as ea,o as ao,c as no,t as io}from"./vendor.e9042f2c.js";import{c as oo}from"./main.9d655092.js";var ta={exports:{}};/*!
* Chart.js v2.9.4
* https://www.chartjs.org
* (c) 2020 Chart.js Contributors

View File

@ -1 +1 @@
import{_ as c}from"./main.d8ec3f25.js";import{o as e,c as t,t as o}from"./vendor.e9042f2c.js";const s={},r={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},n=o("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),a=o("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),l=[n,a];function i(_,d){return e(),t("svg",r,l)}var m=c(s,[["render",i]]);export{m as L};
import{_ as c}from"./main.9d655092.js";import{o as e,c as t,t as o}from"./vendor.e9042f2c.js";const s={},r={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},n=o("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),a=o("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),l=[n,a];function i(_,d){return e(),t("svg",r,l)}var m=c(s,[["render",i]]);export{m as L};

View File

@ -1 +1 @@
import{g as N,C as M,i as w,m as p,n as $,a2 as E,q as j,k as y,r as l,o as c,c as G,b as n,w as u,y as e,s as B,a0 as _,t as b,v as h,x as I,B as L,a as R}from"./vendor.e9042f2c.js";import{u as T,a as U}from"./main.d8ec3f25.js";const A=["onSubmit"],F={class:"mt-5 mb-8"},O={class:"mb-4"},J={setup(P){const k=T(),s=U(),{t:m}=N(),V=M(),d=w(!1);let o=w(!1);const x={email:{required:p.withMessage(m("validation.required"),$),email:p.withMessage(m("validation.email_incorrect"),E)},password:{required:p.withMessage(m("validation.required"),$)}},t=j(x,y(()=>s.loginData)),S=y(()=>o.value?"text":"password");async function q(){if(R.defaults.withCredentials=!0,t.value.$touch(),t.value.$invalid)return!0;d.value=!0;try{d.value=!0,await s.login(s.loginData),V.push("/admin/dashboard"),k.showNotification({type:"success",message:"Logged in successfully."})}catch{d.value=!1}}return(i,a)=>{const g=l("BaseInput"),f=l("BaseInputGroup"),v=l("BaseIcon"),D=l("router-link"),C=l("BaseButton");return c(),G("form",{id:"loginForm",class:"mt-12 text-left",onSubmit:L(q,["prevent"])},[n(f,{error:e(t).email.$error&&e(t).email.$errors[0].$message,label:i.$t("login.email"),class:"mb-4",required:""},{default:u(()=>[n(g,{modelValue:e(s).loginData.email,"onUpdate:modelValue":a[0]||(a[0]=r=>e(s).loginData.email=r),invalid:e(t).email.$error,focus:"",type:"email",name:"email",onInput:a[1]||(a[1]=r=>e(t).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(f,{error:e(t).password.$error&&e(t).password.$errors[0].$message,label:i.$t("login.password"),class:"mb-4",required:""},{default:u(()=>[n(g,{modelValue:e(s).loginData.password,"onUpdate:modelValue":a[4]||(a[4]=r=>e(s).loginData.password=r),invalid:e(t).password.$error,type:e(S),name:"password",onInput:a[5]||(a[5]=r=>e(t).password.$touch())},{right:u(()=>[e(o)?(c(),B(v,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:a[2]||(a[2]=r=>_(o)?o.value=!e(o):o=!e(o))})):(c(),B(v,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:a[3]||(a[3]=r=>_(o)?o.value=!e(o):o=!e(o))}))]),_:1},8,["modelValue","invalid","type"])]),_:1},8,["error","label"]),b("div",F,[b("div",O,[n(D,{to:"forgot-password",class:"text-sm text-primary-400 hover:text-gray-700"},{default:u(()=>[h(I(i.$t("login.forgot_password")),1)]),_:1})])]),n(C,{loading:d.value,type:"submit"},{default:u(()=>[h(I(i.$t("login.login")),1)]),_:1},8,["loading"])],40,A)}}};export{J as default};
import{g as N,C as M,i as w,m as p,n as $,a2 as E,q as j,k as y,r as l,o as c,c as G,b as n,w as u,y as e,s as B,a0 as _,t as b,v as h,x as I,B as L,a as R}from"./vendor.e9042f2c.js";import{u as T,a as U}from"./main.9d655092.js";const A=["onSubmit"],F={class:"mt-5 mb-8"},O={class:"mb-4"},J={setup(P){const k=T(),s=U(),{t:m}=N(),V=M(),d=w(!1);let o=w(!1);const x={email:{required:p.withMessage(m("validation.required"),$),email:p.withMessage(m("validation.email_incorrect"),E)},password:{required:p.withMessage(m("validation.required"),$)}},t=j(x,y(()=>s.loginData)),S=y(()=>o.value?"text":"password");async function q(){if(R.defaults.withCredentials=!0,t.value.$touch(),t.value.$invalid)return!0;d.value=!0;try{d.value=!0,await s.login(s.loginData),V.push("/admin/dashboard"),k.showNotification({type:"success",message:"Logged in successfully."})}catch{d.value=!1}}return(i,a)=>{const g=l("BaseInput"),f=l("BaseInputGroup"),v=l("BaseIcon"),D=l("router-link"),C=l("BaseButton");return c(),G("form",{id:"loginForm",class:"mt-12 text-left",onSubmit:L(q,["prevent"])},[n(f,{error:e(t).email.$error&&e(t).email.$errors[0].$message,label:i.$t("login.email"),class:"mb-4",required:""},{default:u(()=>[n(g,{modelValue:e(s).loginData.email,"onUpdate:modelValue":a[0]||(a[0]=r=>e(s).loginData.email=r),invalid:e(t).email.$error,focus:"",type:"email",name:"email",onInput:a[1]||(a[1]=r=>e(t).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(f,{error:e(t).password.$error&&e(t).password.$errors[0].$message,label:i.$t("login.password"),class:"mb-4",required:""},{default:u(()=>[n(g,{modelValue:e(s).loginData.password,"onUpdate:modelValue":a[4]||(a[4]=r=>e(s).loginData.password=r),invalid:e(t).password.$error,type:e(S),name:"password",onInput:a[5]||(a[5]=r=>e(t).password.$touch())},{right:u(()=>[e(o)?(c(),B(v,{key:0,name:"EyeOffIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:a[2]||(a[2]=r=>_(o)?o.value=!e(o):o=!e(o))})):(c(),B(v,{key:1,name:"EyeIcon",class:"w-5 h-5 mr-1 text-gray-500 cursor-pointer",onClick:a[3]||(a[3]=r=>_(o)?o.value=!e(o):o=!e(o))}))]),_:1},8,["modelValue","invalid","type"])]),_:1},8,["error","label"]),b("div",F,[b("div",O,[n(D,{to:"forgot-password",class:"text-sm text-primary-400 hover:text-gray-700"},{default:u(()=>[h(I(i.$t("login.forgot_password")),1)]),_:1})])]),n(C,{loading:d.value,type:"submit"},{default:u(()=>[h(I(i.$t("login.login")),1)]),_:1},8,["loading"])],40,A)}}};export{J as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{g as k,u as T,am as j,r,o as f,s as p,w as t,y as c,b as u,v as z,x as S,A as C,i as E,k as O,c as F,z as P,F as G,j as V}from"./vendor.e9042f2c.js";import{i as x,u as I,r as A,d as M,g as $,e as D}from"./main.d8ec3f25.js";import{_ as H}from"./NoteModal.13ab9bc5.js";const L={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(g){const d=g,N=x(),_=I(),{t:a}=k(),o=A(),h=T(),y=M(),b=$();j("utils");function w(n){o.fetchNote(n),b.openModal({title:a("settings.customization.notes.edit_note"),componentName:"NoteModal",size:"md",refreshData:d.loadData})}function s(n){N.openDialog({title:a("general.are_you_sure"),message:a("settings.customization.notes.note_confirm_delete"),yesLabel:a("general.yes"),noLabel:a("general.no"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async()=>{(await o.deleteNote(n)).data.success?_.showNotification({type:"success",message:a("settings.customization.notes.deleted_message")}):_.showNotification({type:"error",message:a("settings.customization.notes.already_in_use")}),d.loadData&&d.loadData()})}return(n,e)=>{const i=r("BaseIcon"),m=r("BaseButton"),B=r("BaseDropdownItem"),l=r("BaseDropdown");return f(),p(l,null,{activator:t(()=>[c(h).name==="notes.view"?(f(),p(m,{key:0,variant:"primary"},{default:t(()=>[u(i,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(f(),p(i,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[c(y).hasAbilities(c(D).MANAGE_NOTE)?(f(),p(B,{key:0,onClick:e[0]||(e[0]=v=>w(g.row.id))},{default:t(()=>[u(i,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),z(" "+S(n.$t("general.edit")),1)]),_:1})):C("",!0),c(y).hasAbilities(c(D).MANAGE_NOTE)?(f(),p(B,{key:1,onClick:e[1]||(e[1]=v=>s(g.row.id))},{default:t(()=>[u(i,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),z(" "+S(n.$t("general.delete")),1)]),_:1})):C("",!0)]),_:1})}}},J={setup(g){const{t:d}=k(),N=$();x();const _=A();I();const a=M(),o=E(""),h=O(()=>[{key:"name",label:d("settings.customization.notes.name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"type",label:d("settings.customization.notes.type"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function y({page:s,filter:n,sort:e}){let i=V({orderByField:e.fieldName||"created_at",orderBy:e.order||"desc",page:s}),m=await _.fetchNotes(i);return{data:m.data.data,pagination:{totalPages:m.data.meta.last_page,currentPage:s,totalCount:m.data.meta.total,limit:5}}}async function b(){await N.openModal({title:d("settings.customization.notes.add_note"),componentName:"NoteModal",size:"md",refreshData:o.value&&o.value.refresh})}async function w(){o.value&&o.value.refresh()}return(s,n)=>{const e=r("BaseIcon"),i=r("BaseButton"),m=r("BaseTable"),B=r("BaseSettingCard");return f(),F(G,null,[u(H),u(B,{title:s.$t("settings.customization.notes.title"),description:s.$t("settings.customization.notes.description")},{action:t(()=>[c(a).hasAbilities(c(D).MANAGE_NOTE)?(f(),p(i,{key:0,variant:"primary-outline",onClick:b},{left:t(l=>[u(e,{class:P(l.class),name:"PlusIcon"},null,8,["class"])]),default:t(()=>[z(" "+S(s.$t("settings.customization.notes.add_note")),1)]),_:1})):C("",!0)]),default:t(()=>[u(m,{ref:(l,v)=>{v.table=l,o.value=l},data:y,columns:c(h),class:"mt-14"},{"cell-actions":t(({row:l})=>[u(L,{row:l.data,table:o.value,"load-data":w},null,8,["row","table"])]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{J as default};
import{g as k,u as T,am as j,r,o as p,s as f,w as t,y as c,b as u,v as z,x as S,A as C,i as E,k as O,c as F,z as P,F as G,j as V}from"./vendor.e9042f2c.js";import{i as x,u as I,r as A,d as M,g as $,e as D}from"./main.9d655092.js";import{_ as H}from"./NoteModal.4c55688d.js";const L={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(g){const d=g,N=x(),_=I(),{t:a}=k(),o=A(),h=T(),y=M(),b=$();j("utils");function w(n){o.fetchNote(n),b.openModal({title:a("settings.customization.notes.edit_note"),componentName:"NoteModal",size:"md",refreshData:d.loadData})}function s(n){N.openDialog({title:a("general.are_you_sure"),message:a("settings.customization.notes.note_confirm_delete"),yesLabel:a("general.yes"),noLabel:a("general.no"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async()=>{(await o.deleteNote(n)).data.success?_.showNotification({type:"success",message:a("settings.customization.notes.deleted_message")}):_.showNotification({type:"error",message:a("settings.customization.notes.already_in_use")}),d.loadData&&d.loadData()})}return(n,e)=>{const i=r("BaseIcon"),m=r("BaseButton"),B=r("BaseDropdownItem"),l=r("BaseDropdown");return p(),f(l,null,{activator:t(()=>[c(h).name==="notes.view"?(p(),f(m,{key:0,variant:"primary"},{default:t(()=>[u(i,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(p(),f(i,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:t(()=>[c(y).hasAbilities(c(D).MANAGE_NOTE)?(p(),f(B,{key:0,onClick:e[0]||(e[0]=v=>w(g.row.id))},{default:t(()=>[u(i,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),z(" "+S(n.$t("general.edit")),1)]),_:1})):C("",!0),c(y).hasAbilities(c(D).MANAGE_NOTE)?(p(),f(B,{key:1,onClick:e[1]||(e[1]=v=>s(g.row.id))},{default:t(()=>[u(i,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),z(" "+S(n.$t("general.delete")),1)]),_:1})):C("",!0)]),_:1})}}},J={setup(g){const{t:d}=k(),N=$();x();const _=A();I();const a=M(),o=E(""),h=O(()=>[{key:"name",label:d("settings.customization.notes.name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"type",label:d("settings.customization.notes.type"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function y({page:s,filter:n,sort:e}){let i=V({orderByField:e.fieldName||"created_at",orderBy:e.order||"desc",page:s}),m=await _.fetchNotes(i);return{data:m.data.data,pagination:{totalPages:m.data.meta.last_page,currentPage:s,totalCount:m.data.meta.total,limit:5}}}async function b(){await N.openModal({title:d("settings.customization.notes.add_note"),componentName:"NoteModal",size:"md",refreshData:o.value&&o.value.refresh})}async function w(){o.value&&o.value.refresh()}return(s,n)=>{const e=r("BaseIcon"),i=r("BaseButton"),m=r("BaseTable"),B=r("BaseSettingCard");return p(),F(G,null,[u(H),u(B,{title:s.$t("settings.customization.notes.title"),description:s.$t("settings.customization.notes.description")},{action:t(()=>[c(a).hasAbilities(c(D).MANAGE_NOTE)?(p(),f(i,{key:0,variant:"primary-outline",onClick:b},{left:t(l=>[u(e,{class:P(l.class),name:"PlusIcon"},null,8,["class"])]),default:t(()=>[z(" "+S(s.$t("settings.customization.notes.add_note")),1)]),_:1})):C("",!0)]),default:t(()=>[u(m,{ref:(l,v)=>{v.table=l,o.value=l},data:y,columns:c(h),class:"mt-14"},{"cell-actions":t(({row:l})=>[u(L,{row:l.data,table:o.value,"load-data":w},null,8,["row","table"])]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{J as default};

View File

@ -1 +1 @@
import{i as h,g as k,j as E,k as m,m as y,n as F,a2 as M,q as Y,r as o,o as w,s as S,w as u,t as v,b as d,y as i,z as j,A as D,v as U,x as z,B as G,a0 as B}from"./vendor.e9042f2c.js";import{c as O}from"./main.d8ec3f25.js";const A=["onSubmit"],R={class:"grid-cols-2 col-span-1 mt-14"},T={class:"divide-y divide-gray-200"},L={setup(H){const s=O();let r=h(!1);const{t:f}=k(),n=E({notify_invoice_viewed:s.selectedCompanySettings.notify_invoice_viewed,notify_estimate_viewed:s.selectedCompanySettings.notify_estimate_viewed,notification_email:s.selectedCompanySettings.notification_email}),$=m(()=>({notification_email:{required:y.withMessage(f("validation.required"),F),email:y.withMessage(f("validation.email_incorrect"),M)}})),l=Y($,m(()=>n)),_=m({get:()=>n.notify_invoice_viewed==="YES",set:async e=>{const t=e?"YES":"NO";let c={settings:{notify_invoice_viewed:t}};n.notify_invoice_viewed=t,await s.updateCompanySettings({data:c,message:"general.setting_updated"})}}),p=m({get:()=>n.notify_estimate_viewed==="YES",set:async e=>{const t=e?"YES":"NO";let c={settings:{notify_estimate_viewed:t}};n.notify_estimate_viewed=t,await s.updateCompanySettings({data:c,message:"general.setting_updated"})}});async function V(){if(l.value.$touch(),l.value.$invalid)return!0;r.value=!0;const e={settings:{notification_email:n.notification_email}};await s.updateCompanySettings({data:e,message:"settings.notification.email_save_message"}),r.value=!1}return(e,t)=>{const c=o("BaseInput"),C=o("BaseInputGroup"),b=o("BaseIcon"),I=o("BaseButton"),N=o("BaseDivider"),g=o("BaseSwitchSection"),q=o("BaseSettingCard");return w(),S(q,{title:e.$t("settings.notification.title"),description:e.$t("settings.notification.description")},{default:u(()=>[v("form",{action:"",onSubmit:G(V,["prevent"])},[v("div",R,[d(C,{error:i(l).notification_email.$error&&i(l).notification_email.$errors[0].$message,label:e.$t("settings.notification.email"),class:"my-2",required:""},{default:u(()=>[d(c,{modelValue:i(n).notification_email,"onUpdate:modelValue":t[0]||(t[0]=a=>i(n).notification_email=a),modelModifiers:{trim:!0},invalid:i(l).notification_email.$error,type:"email",onInput:t[1]||(t[1]=a=>i(l).notification_email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),d(I,{disabled:i(r),loading:i(r),variant:"primary",type:"submit",class:"mt-6"},{left:u(a=>[i(r)?D("",!0):(w(),S(b,{key:0,class:j(a.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[U(" "+z(e.$tc("settings.notification.save")),1)]),_:1},8,["disabled","loading"])])],40,A),d(N,{class:"mt-6 mb-2"}),v("ul",T,[d(g,{modelValue:i(_),"onUpdate:modelValue":t[2]||(t[2]=a=>B(_)?_.value=a:null),title:e.$t("settings.notification.invoice_viewed"),description:e.$t("settings.notification.invoice_viewed_desc")},null,8,["modelValue","title","description"]),d(g,{modelValue:i(p),"onUpdate:modelValue":t[3]||(t[3]=a=>B(p)?p.value=a:null),title:e.$t("settings.notification.estimate_viewed"),description:e.$t("settings.notification.estimate_viewed_desc")},null,8,["modelValue","title","description"])])]),_:1},8,["title","description"])}}};export{L as default};
import{i as h,g as k,j as E,k as m,m as y,n as F,a2 as M,q as Y,r as o,o as w,s as S,w as u,t as v,b as d,y as i,z as j,A as D,v as U,x as z,B as G,a0 as B}from"./vendor.e9042f2c.js";import{c as O}from"./main.9d655092.js";const A=["onSubmit"],R={class:"grid-cols-2 col-span-1 mt-14"},T={class:"divide-y divide-gray-200"},L={setup(H){const s=O();let r=h(!1);const{t:f}=k(),n=E({notify_invoice_viewed:s.selectedCompanySettings.notify_invoice_viewed,notify_estimate_viewed:s.selectedCompanySettings.notify_estimate_viewed,notification_email:s.selectedCompanySettings.notification_email}),$=m(()=>({notification_email:{required:y.withMessage(f("validation.required"),F),email:y.withMessage(f("validation.email_incorrect"),M)}})),l=Y($,m(()=>n)),_=m({get:()=>n.notify_invoice_viewed==="YES",set:async e=>{const t=e?"YES":"NO";let c={settings:{notify_invoice_viewed:t}};n.notify_invoice_viewed=t,await s.updateCompanySettings({data:c,message:"general.setting_updated"})}}),p=m({get:()=>n.notify_estimate_viewed==="YES",set:async e=>{const t=e?"YES":"NO";let c={settings:{notify_estimate_viewed:t}};n.notify_estimate_viewed=t,await s.updateCompanySettings({data:c,message:"general.setting_updated"})}});async function V(){if(l.value.$touch(),l.value.$invalid)return!0;r.value=!0;const e={settings:{notification_email:n.notification_email}};await s.updateCompanySettings({data:e,message:"settings.notification.email_save_message"}),r.value=!1}return(e,t)=>{const c=o("BaseInput"),C=o("BaseInputGroup"),b=o("BaseIcon"),I=o("BaseButton"),N=o("BaseDivider"),g=o("BaseSwitchSection"),q=o("BaseSettingCard");return w(),S(q,{title:e.$t("settings.notification.title"),description:e.$t("settings.notification.description")},{default:u(()=>[v("form",{action:"",onSubmit:G(V,["prevent"])},[v("div",R,[d(C,{error:i(l).notification_email.$error&&i(l).notification_email.$errors[0].$message,label:e.$t("settings.notification.email"),class:"my-2",required:""},{default:u(()=>[d(c,{modelValue:i(n).notification_email,"onUpdate:modelValue":t[0]||(t[0]=a=>i(n).notification_email=a),modelModifiers:{trim:!0},invalid:i(l).notification_email.$error,type:"email",onInput:t[1]||(t[1]=a=>i(l).notification_email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),d(I,{disabled:i(r),loading:i(r),variant:"primary",type:"submit",class:"mt-6"},{left:u(a=>[i(r)?D("",!0):(w(),S(b,{key:0,class:j(a.class),name:"SaveIcon"},null,8,["class"]))]),default:u(()=>[U(" "+z(e.$tc("settings.notification.save")),1)]),_:1},8,["disabled","loading"])])],40,A),d(N,{class:"mt-6 mb-2"}),v("ul",T,[d(g,{modelValue:i(_),"onUpdate:modelValue":t[2]||(t[2]=a=>B(_)?_.value=a:null),title:e.$t("settings.notification.invoice_viewed"),description:e.$t("settings.notification.invoice_viewed_desc")},null,8,["modelValue","title","description"]),d(g,{modelValue:i(p),"onUpdate:modelValue":t[3]||(t[3]=a=>B(p)?p.value=a:null),title:e.$t("settings.notification.estimate_viewed"),description:e.$t("settings.notification.estimate_viewed_desc")},null,8,["modelValue","title","description"])])]),_:1},8,["title","description"])}}};export{L as default};

View File

@ -1 +1 @@
import{g as I,i as S,k as p,m as P,n as V,p as C,q as k,r as u,o as q,s as j,w as r,t as c,v as y,x as v,y as t,b as s,z as x,B as N}from"./vendor.e9042f2c.js";import{g as z,o as D}from"./main.d8ec3f25.js";const G={class:"flex justify-between w-full"},L=["onSubmit"],T={class:"p-4 sm:p-6"},A={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid"},F={setup(U){const o=z(),e=D(),{t:f}=I(),l=S(!1),g=p(()=>({currentPaymentMode:{name:{required:P.withMessage(f("validation.required"),V),minLength:P.withMessage(f("validation.name_min_length",{count:3}),C(3))}}})),a=k(g,p(()=>e)),h=p(()=>o.active&&o.componentName==="PaymentModeModal");async function B(){if(a.value.currentPaymentMode.$touch(),a.value.currentPaymentMode.$invalid)return!0;try{const n=e.currentPaymentMode.id?e.updatePaymentMode:e.addPaymentMode;l.value=!0,await n(e.currentPaymentMode),l.value=!1,o.refreshData&&o.refreshData(),d()}catch{return l.value=!1,!0}}function d(){o.closeModal(),setTimeout(()=>{a.value.$reset(),e.currentPaymentMode={id:"",name:null}})}return(n,i)=>{const M=u("BaseIcon"),b=u("BaseInput"),$=u("BaseInputGroup"),_=u("BaseButton"),w=u("BaseModal");return q(),j(w,{show:t(h),onClose:d},{header:r(()=>[c("div",G,[y(v(t(o).title)+" ",1),s(M,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[c("form",{action:"",onSubmit:N(B,["prevent"])},[c("div",T,[s($,{label:n.$t("settings.payment_modes.mode_name"),error:t(a).currentPaymentMode.name.$error&&t(a).currentPaymentMode.name.$errors[0].$message,required:""},{default:r(()=>[s(b,{modelValue:t(e).currentPaymentMode.name,"onUpdate:modelValue":i[0]||(i[0]=m=>t(e).currentPaymentMode.name=m),invalid:t(a).currentPaymentMode.name.$error,onInput:i[1]||(i[1]=m=>t(a).currentPaymentMode.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),c("div",A,[s(_,{variant:"primary-outline",class:"mr-3",type:"button",onClick:d},{default:r(()=>[y(v(n.$t("general.cancel")),1)]),_:1}),s(_,{loading:l.value,disabled:l.value,variant:"primary",type:"submit"},{left:r(m=>[s(M,{name:"SaveIcon",class:x(m.class)},null,8,["class"])]),default:r(()=>[y(" "+v(t(e).currentPaymentMode.id?n.$t("general.update"):n.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,L)]),_:1},8,["show"])}}};export{F as _};
import{g as I,i as S,k as p,m as P,n as V,p as C,q as k,r as u,o as q,s as j,w as r,t as c,v as y,x as v,y as t,b as s,z as x,B as N}from"./vendor.e9042f2c.js";import{g as z,o as D}from"./main.9d655092.js";const G={class:"flex justify-between w-full"},L=["onSubmit"],T={class:"p-4 sm:p-6"},A={class:"z-0 flex justify-end p-4 border-t border-gray-200 border-solid"},F={setup(U){const o=z(),e=D(),{t:M}=I(),l=S(!1),g=p(()=>({currentPaymentMode:{name:{required:P.withMessage(M("validation.required"),V),minLength:P.withMessage(M("validation.name_min_length",{count:3}),C(3))}}})),a=k(g,p(()=>e)),h=p(()=>o.active&&o.componentName==="PaymentModeModal");async function B(){if(a.value.currentPaymentMode.$touch(),a.value.currentPaymentMode.$invalid)return!0;try{const n=e.currentPaymentMode.id?e.updatePaymentMode:e.addPaymentMode;l.value=!0,await n(e.currentPaymentMode),l.value=!1,o.refreshData&&o.refreshData(),d()}catch{return l.value=!1,!0}}function d(){o.closeModal(),setTimeout(()=>{a.value.$reset(),e.currentPaymentMode={id:"",name:null}})}return(n,i)=>{const f=u("BaseIcon"),b=u("BaseInput"),$=u("BaseInputGroup"),_=u("BaseButton"),w=u("BaseModal");return q(),j(w,{show:t(h),onClose:d},{header:r(()=>[c("div",G,[y(v(t(o).title)+" ",1),s(f,{name:"XIcon",class:"w-6 h-6 text-gray-500 cursor-pointer",onClick:d})])]),default:r(()=>[c("form",{action:"",onSubmit:N(B,["prevent"])},[c("div",T,[s($,{label:n.$t("settings.payment_modes.mode_name"),error:t(a).currentPaymentMode.name.$error&&t(a).currentPaymentMode.name.$errors[0].$message,required:""},{default:r(()=>[s(b,{modelValue:t(e).currentPaymentMode.name,"onUpdate:modelValue":i[0]||(i[0]=m=>t(e).currentPaymentMode.name=m),invalid:t(a).currentPaymentMode.name.$error,onInput:i[1]||(i[1]=m=>t(a).currentPaymentMode.name.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"])]),c("div",A,[s(_,{variant:"primary-outline",class:"mr-3",type:"button",onClick:d},{default:r(()=>[y(v(n.$t("general.cancel")),1)]),_:1}),s(_,{loading:l.value,disabled:l.value,variant:"primary",type:"submit"},{left:r(m=>[s(f,{name:"SaveIcon",class:x(m.class)},null,8,["class"])]),default:r(()=>[y(" "+v(t(e).currentPaymentMode.id?n.$t("general.update"):n.$t("general.save")),1)]),_:1},8,["loading","disabled"])])],40,L)]),_:1},8,["show"])}}};export{F as _};

View File

@ -1 +1 @@
import{g as D,u as I,am as x,r as m,o as p,s as v,w as a,y as M,b as t,v as b,x as w,i as $,k as z,c as N,z as j,F as T}from"./vendor.e9042f2c.js";import{i as P,u as F,o as C,d as H,g as S}from"./main.d8ec3f25.js";import{_ as L}from"./PaymentModeModal.512d997d.js";const O={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(u){const c=u,y=P();F();const{t:s}=D(),o=C(),f=I();H();const _=S();x("utils");function g(e){o.fetchPaymentMode(e),_.openModal({title:s("settings.payment_modes.edit_payment_mode"),componentName:"PaymentModeModal",refreshData:c.loadData&&c.loadData,size:"sm"})}function B(e){y.openDialog({title:s("general.are_you_sure"),message:s("settings.payment_modes.payment_mode_confirm_delete"),yesLabel:s("general.ok"),noLabel:s("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async l=>{l&&(await o.deletePaymentMode(e),c.loadData&&c.loadData())})}return(e,l)=>{const n=m("BaseIcon"),i=m("BaseButton"),r=m("BaseDropdownItem"),h=m("BaseDropdown");return p(),v(h,null,{activator:a(()=>[M(f).name==="paymentModes.view"?(p(),v(i,{key:0,variant:"primary"},{default:a(()=>[t(n,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(p(),v(n,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:a(()=>[t(r,{onClick:l[0]||(l[0]=d=>g(u.row.id))},{default:a(()=>[t(n,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),b(" "+w(e.$t("general.edit")),1)]),_:1}),t(r,{onClick:l[1]||(l[1]=d=>B(u.row.id))},{default:a(()=>[t(n,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),b(" "+w(e.$t("general.delete")),1)]),_:1})]),_:1})}}},U={setup(u){const c=S();P();const y=C(),{t:s}=D(),o=$(null),f=z(()=>[{key:"name",label:s("settings.payment_modes.mode_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function _(){o.value&&o.value.refresh()}async function g({page:e,filter:l,sort:n}){let i={orderByField:n.fieldName||"created_at",orderBy:n.order||"desc",page:e},r=await y.fetchPaymentModes(i);return{data:r.data.data,pagination:{totalPages:r.data.meta.last_page,currentPage:e,totalCount:r.data.meta.total,limit:5}}}function B(){c.openModal({title:s("settings.payment_modes.add_payment_mode"),componentName:"PaymentModeModal",refreshData:o.value&&o.value.refresh,size:"sm"})}return(e,l)=>{const n=m("BaseIcon"),i=m("BaseButton"),r=m("BaseTable"),h=m("BaseSettingCard");return p(),N(T,null,[t(L),t(h,{title:e.$t("settings.payment_modes.title"),description:e.$t("settings.payment_modes.description")},{action:a(()=>[t(i,{type:"submit",variant:"primary-outline",onClick:B},{left:a(d=>[t(n,{class:j(d.class),name:"PlusIcon"},null,8,["class"])]),default:a(()=>[b(" "+w(e.$t("settings.payment_modes.add_payment_mode")),1)]),_:1})]),default:a(()=>[t(r,{ref:(d,k)=>{k.table=d,o.value=d},data:g,columns:M(f),class:"mt-16"},{"cell-actions":a(({row:d})=>[t(O,{row:d.data,table:o.value,"load-data":_},null,8,["row","table"])]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{U as default};
import{g as D,u as I,am as x,r as d,o as p,s as v,w as a,y as M,b as t,v as b,x as w,i as $,k as z,c as N,z as j,F as T}from"./vendor.e9042f2c.js";import{i as P,u as F,o as C,d as H,g as S}from"./main.9d655092.js";import{_ as L}from"./PaymentModeModal.118ad948.js";const O={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:null}},setup(u){const c=u,y=P();F();const{t:s}=D(),o=C(),_=I();H();const f=S();x("utils");function g(e){o.fetchPaymentMode(e),f.openModal({title:s("settings.payment_modes.edit_payment_mode"),componentName:"PaymentModeModal",refreshData:c.loadData&&c.loadData,size:"sm"})}function B(e){y.openDialog({title:s("general.are_you_sure"),message:s("settings.payment_modes.payment_mode_confirm_delete"),yesLabel:s("general.ok"),noLabel:s("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async l=>{l&&(await o.deletePaymentMode(e),c.loadData&&c.loadData())})}return(e,l)=>{const n=d("BaseIcon"),i=d("BaseButton"),r=d("BaseDropdownItem"),h=d("BaseDropdown");return p(),v(h,null,{activator:a(()=>[M(_).name==="paymentModes.view"?(p(),v(i,{key:0,variant:"primary"},{default:a(()=>[t(n,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(p(),v(n,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:a(()=>[t(r,{onClick:l[0]||(l[0]=m=>g(u.row.id))},{default:a(()=>[t(n,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),b(" "+w(e.$t("general.edit")),1)]),_:1}),t(r,{onClick:l[1]||(l[1]=m=>B(u.row.id))},{default:a(()=>[t(n,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),b(" "+w(e.$t("general.delete")),1)]),_:1})]),_:1})}}},U={setup(u){const c=S();P();const y=C(),{t:s}=D(),o=$(null),_=z(()=>[{key:"name",label:s("settings.payment_modes.mode_name"),thClass:"extra",tdClass:"font-medium text-gray-900"},{key:"actions",label:"",tdClass:"text-right text-sm font-medium",sortable:!1}]);async function f(){o.value&&o.value.refresh()}async function g({page:e,filter:l,sort:n}){let i={orderByField:n.fieldName||"created_at",orderBy:n.order||"desc",page:e},r=await y.fetchPaymentModes(i);return{data:r.data.data,pagination:{totalPages:r.data.meta.last_page,currentPage:e,totalCount:r.data.meta.total,limit:5}}}function B(){c.openModal({title:s("settings.payment_modes.add_payment_mode"),componentName:"PaymentModeModal",refreshData:o.value&&o.value.refresh,size:"sm"})}return(e,l)=>{const n=d("BaseIcon"),i=d("BaseButton"),r=d("BaseTable"),h=d("BaseSettingCard");return p(),N(T,null,[t(L),t(h,{title:e.$t("settings.payment_modes.title"),description:e.$t("settings.payment_modes.description")},{action:a(()=>[t(i,{type:"submit",variant:"primary-outline",onClick:B},{left:a(m=>[t(n,{class:j(m.class),name:"PlusIcon"},null,8,["class"])]),default:a(()=>[b(" "+w(e.$t("settings.payment_modes.add_payment_mode")),1)]),_:1})]),default:a(()=>[t(r,{ref:(m,k)=>{k.table=m,o.value=m},data:g,columns:M(_),class:"mt-16"},{"cell-actions":a(({row:m})=>[t(O,{row:m.data,table:o.value,"load-data":f},null,8,["row","table"])]),_:1},8,["columns"])]),_:1},8,["title","description"])],64)}}};export{U as default};

View File

@ -1 +0,0 @@
import{g as N,u as E,C as k,am as C,r as c,o as n,s as a,w as o,y as t,b as s,v as p,x as v,A as I}from"./vendor.e9042f2c.js";import{B as b,u as x,i as S,d as V,e as _}from"./main.d8ec3f25.js";const O={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(d){const g=b(),y=x(),R=S(),m=V(),{t:r}=N(),w=E();k(),C("utils");async function B(i=null){R.openDialog({title:r("general.are_you_sure"),message:r("invoices.confirm_delete"),yesLabel:r("general.ok"),noLabel:r("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async l=>{l&&await g.deleteMultipleRecurringInvoices(i).then(e=>{e.data.success?(g.$patch(u=>{u.selectedRecurringInvoices=[],u.selectAllField=!1}),y.showNotification({type:"success",message:r("recurring_invoices.deleted_message",2)})):e.data.error&&y.showNotification({type:"error",message:e.data.message})})})}return(i,l)=>{const e=c("BaseIcon"),u=c("BaseButton"),f=c("BaseDropdownItem"),h=c("router-link"),D=c("BaseDropdown");return n(),a(D,{"content-loading":t(g).isFetchingViewData},{activator:o(()=>[t(w).name==="recurring-invoices.view"?(n(),a(u,{key:0,variant:"primary"},{default:o(()=>[s(e,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(n(),a(e,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:o(()=>[t(m).hasAbilities(t(_).EDIT_RECURRING_INVOICE)?(n(),a(h,{key:0,to:`/admin/recurring-invoices/${d.row.id}/edit`},{default:o(()=>[s(f,null,{default:o(()=>[s(e,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+v(i.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):I("",!0),t(w).name!=="recurring-invoices.view"&&t(m).hasAbilities(t(_).VIEW_RECURRING_INVOICE)?(n(),a(h,{key:1,to:`recurring-invoices/${d.row.id}/view`},{default:o(()=>[s(f,null,{default:o(()=>[s(e,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+v(i.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):I("",!0),t(m).hasAbilities(t(_).DELETE_RECURRING_INVOICE)?(n(),a(f,{key:2,onClick:l[0]||(l[0]=$=>B(d.row.id))},{default:o(()=>[s(e,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+v(i.$t("general.delete")),1)]),_:1})):I("",!0)]),_:1},8,["content-loading"])}}};export{O as _};

View File

@ -0,0 +1 @@
import{g as b,u as E,C as k,am as C,r as c,o as n,s as a,w as o,y as t,b as s,v as p,x as v,A as I}from"./vendor.e9042f2c.js";import{B as x,u as S,i as V,d as $,e as y}from"./main.9d655092.js";const T={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(l){const _=l,g=x(),w=S(),B=V(),m=$(),{t:r}=b(),h=E();k(),C("utils");async function D(i=null){B.openDialog({title:r("general.are_you_sure"),message:r("invoices.confirm_delete"),yesLabel:r("general.ok"),noLabel:r("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async u=>{u&&await g.deleteMultipleRecurringInvoices(i).then(e=>{e.data.success?(_.table&&_.table.refresh(),g.$patch(d=>{d.selectedRecurringInvoices=[],d.selectAllField=!1}),w.showNotification({type:"success",message:r("recurring_invoices.deleted_message",2)})):e.data.error&&w.showNotification({type:"error",message:e.data.message})})})}return(i,u)=>{const e=c("BaseIcon"),d=c("BaseButton"),f=c("BaseDropdownItem"),R=c("router-link"),N=c("BaseDropdown");return n(),a(N,{"content-loading":t(g).isFetchingViewData},{activator:o(()=>[t(h).name==="recurring-invoices.view"?(n(),a(d,{key:0,variant:"primary"},{default:o(()=>[s(e,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(n(),a(e,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:o(()=>[t(m).hasAbilities(t(y).EDIT_RECURRING_INVOICE)?(n(),a(R,{key:0,to:`/admin/recurring-invoices/${l.row.id}/edit`},{default:o(()=>[s(f,null,{default:o(()=>[s(e,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+v(i.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):I("",!0),t(h).name!=="recurring-invoices.view"&&t(m).hasAbilities(t(y).VIEW_RECURRING_INVOICE)?(n(),a(R,{key:1,to:`recurring-invoices/${l.row.id}/view`},{default:o(()=>[s(f,null,{default:o(()=>[s(e,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+v(i.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):I("",!0),t(m).hasAbilities(t(y).DELETE_RECURRING_INVOICE)?(n(),a(f,{key:2,onClick:u[0]||(u[0]=j=>D(l.row.id))},{default:o(()=>[s(e,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+v(i.$t("general.delete")),1)]),_:1})):I("",!0)]),_:1},8,["content-loading"])}}};export{T as _};

View File

@ -1 +1 @@
import{g as q,u as I,C as h,j as S,i as k,k as d,n as w,a2 as L,p as C,aQ as N,q as P,r as f,o as j,c as A,b as n,w as m,y as r,v as E,x as U,B as x,a as D}from"./vendor.e9042f2c.js";import{u as G,h as R}from"./main.d8ec3f25.js";const F=["onSubmit"],z={setup(M){const v=G(),{t}=q(),c=I(),$=h(),o=S({email:"",password:"",password_confirmation:""}),u=k(!1),_=d(()=>({email:{required:w,email:L},password:{required:w,minLength:C(8)},password_confirmation:{sameAsPassword:N(o.password)}})),a=P(_,o),g=d(()=>a.value.email.$error?a.value.email.required.$invalid?t("validation.required"):a.value.email.email?t("validation.email_incorrect"):!1:""),b=d(()=>a.value.password.$error?a.value.password.required.$invalid?t("validation.required"):a.value.password.minLength?t("validation.password_min_length",{count:a.value.password.minLength.$params.min}):!1:""),y=d(()=>a.value.password_confirmation.$error?a.value.password_confirmation.sameAsPassword.$invalid?t("validation.password_incorrect"):!1:"");async function V(i){if(a.value.$touch(),!a.value.$invalid)try{let e={email:o.email,password:o.password,password_confirmation:o.password_confirmation,token:c.params.token};u.value=!0;let l=await D.post("/api/v1/auth/reset/password",e);u.value=!1,l.data&&(v.showNotification({type:"success",message:t("login.password_reset_successfully")}),$.push("/login"))}catch(e){R(e),u.value=!1,e.response&&e.response.status===403}}return(i,e)=>{const l=f("BaseInput"),p=f("BaseInputGroup"),B=f("BaseButton");return j(),A("form",{id:"loginForm",onSubmit:x(V,["prevent"])},[n(p,{error:r(g),label:i.$t("login.email"),class:"mb-4",required:""},{default:m(()=>[n(l,{modelValue:r(o).email,"onUpdate:modelValue":e[0]||(e[0]=s=>r(o).email=s),invalid:r(a).email.$error,focus:"",type:"email",name:"email",onInput:e[1]||(e[1]=s=>r(a).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(p,{error:r(b),label:i.$t("login.password"),class:"mb-4",required:""},{default:m(()=>[n(l,{modelValue:r(o).password,"onUpdate:modelValue":e[2]||(e[2]=s=>r(o).password=s),invalid:r(a).password.$error,type:"password",name:"password",onInput:e[3]||(e[3]=s=>r(a).password.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(p,{error:r(y),label:i.$t("login.retype_password"),class:"mb-4",required:""},{default:m(()=>[n(l,{modelValue:r(o).password_confirmation,"onUpdate:modelValue":e[4]||(e[4]=s=>r(o).password_confirmation=s),invalid:r(a).password_confirmation.$error,type:"password",name:"password",onInput:e[5]||(e[5]=s=>r(a).password_confirmation.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(B,{loading:u.value,type:"submit",variant:"primary"},{default:m(()=>[E(U(i.$t("login.reset_password")),1)]),_:1},8,["loading"])],40,F)}}};export{z as default};
import{g as q,u as I,C as h,j as S,i as k,k as d,n as w,a2 as L,p as C,aQ as N,q as P,r as f,o as j,c as A,b as n,w as m,y as r,v as E,x as U,B as x,a as D}from"./vendor.e9042f2c.js";import{u as G,h as R}from"./main.9d655092.js";const F=["onSubmit"],z={setup(M){const v=G(),{t}=q(),c=I(),$=h(),o=S({email:"",password:"",password_confirmation:""}),u=k(!1),_=d(()=>({email:{required:w,email:L},password:{required:w,minLength:C(8)},password_confirmation:{sameAsPassword:N(o.password)}})),a=P(_,o),g=d(()=>a.value.email.$error?a.value.email.required.$invalid?t("validation.required"):a.value.email.email?t("validation.email_incorrect"):!1:""),b=d(()=>a.value.password.$error?a.value.password.required.$invalid?t("validation.required"):a.value.password.minLength?t("validation.password_min_length",{count:a.value.password.minLength.$params.min}):!1:""),y=d(()=>a.value.password_confirmation.$error?a.value.password_confirmation.sameAsPassword.$invalid?t("validation.password_incorrect"):!1:"");async function V(i){if(a.value.$touch(),!a.value.$invalid)try{let e={email:o.email,password:o.password,password_confirmation:o.password_confirmation,token:c.params.token};u.value=!0;let l=await D.post("/api/v1/auth/reset/password",e);u.value=!1,l.data&&(v.showNotification({type:"success",message:t("login.password_reset_successfully")}),$.push("/login"))}catch(e){R(e),u.value=!1,e.response&&e.response.status===403}}return(i,e)=>{const l=f("BaseInput"),p=f("BaseInputGroup"),B=f("BaseButton");return j(),A("form",{id:"loginForm",onSubmit:x(V,["prevent"])},[n(p,{error:r(g),label:i.$t("login.email"),class:"mb-4",required:""},{default:m(()=>[n(l,{modelValue:r(o).email,"onUpdate:modelValue":e[0]||(e[0]=s=>r(o).email=s),invalid:r(a).email.$error,focus:"",type:"email",name:"email",onInput:e[1]||(e[1]=s=>r(a).email.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(p,{error:r(b),label:i.$t("login.password"),class:"mb-4",required:""},{default:m(()=>[n(l,{modelValue:r(o).password,"onUpdate:modelValue":e[2]||(e[2]=s=>r(o).password=s),invalid:r(a).password.$error,type:"password",name:"password",onInput:e[3]||(e[3]=s=>r(a).password.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(p,{error:r(y),label:i.$t("login.retype_password"),class:"mb-4",required:""},{default:m(()=>[n(l,{modelValue:r(o).password_confirmation,"onUpdate:modelValue":e[4]||(e[4]=s=>r(o).password_confirmation=s),invalid:r(a).password_confirmation.$error,type:"password",name:"password",onInput:e[5]||(e[5]=s=>r(a).password_confirmation.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["error","label"]),n(B,{loading:u.value,type:"submit",variant:"primary"},{default:m(()=>[E(U(i.$t("login.reset_password")),1)]),_:1},8,["loading"])],40,F)}}};export{z as default};

View File

@ -1 +1 @@
var E=Object.defineProperty;var h=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var g=(s,t,e)=>t in s?E(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,x=(s,t)=>{for(var e in t||(t={}))P.call(t,e)&&g(s,e,t[e]);if(h)for(var e of h(t))T.call(t,e)&&g(s,e,t[e]);return s};import{i as k,g as F,k as L,r as w,o as l,c as i,b as r,t as n,w as p,y as o,s as O,v as D,x as m,z as U,a6 as G,A as N,T as H,a7 as W,F as C,H as q,a8 as J}from"./vendor.e9042f2c.js";import{g as K,r as Q,d as R,e as B}from"./main.d8ec3f25.js";import{_ as X}from"./NoteModal.13ab9bc5.js";const Y={class:"w-full"},Z={class:"overflow-hidden rounded-md shadow-lg ring-1 ring-black ring-opacity-5"},ee={class:"relative grid bg-white"},te={class:"relative p-4"},se={key:0,class:"relative flex flex-col overflow-auto list max-h-36"},oe=["onClick"],ae={class:"flex justify-between px-2"},ne={class:"m-0 text-base font-semibold leading-tight text-gray-700 cursor-pointer"},le={key:1,class:"flex justify-center p-5 text-gray-400"},re={class:"text-base text-gray-500"},ie={class:"m-0 ml-3 text-sm leading-none cursor-pointer font-base text-primary-400"},fe={props:{type:{type:String,default:null}},emits:["select"],setup(s,{emit:t}){const e=s;k(null);const{t:I}=F(),c=k(null),S=K(),d=Q(),y=R(),_=L(()=>c.value?d.notes.filter(function(a){return a.name.toLowerCase().indexOf(c.value.toLowerCase())!==-1}):d.notes);async function V(){await d.fetchNotes({filter:{},orderByField:"",orderBy:"",type:e.type?e.type:""})}function z(a,u){t("select",x({},d.notes[a])),c.value=null,u()}function j(){S.openModal({title:I("settings.customization.notes.add_note"),componentName:"NoteModal",size:"lg",data:e.type})}return(a,u)=>{const v=w("BaseIcon"),M=w("BaseInput");return l(),i(C,null,[r(X),n("div",Y,[r(o(J),null,{default:p(({isOpen:$})=>[o(y).hasAbilities(o(B).VIEW_NOTE)?(l(),O(o(G),{key:0,class:U([$?"":"text-opacity-90","flex items-center z-10 font-medium text-primary-400 focus:outline-none focus:border-none"]),onClick:V},{default:p(()=>[r(v,{name:"PlusIcon",class:"w-4 h-4 font-medium text-primary-400"}),D(" "+m(a.$t("general.insert_note")),1)]),_:2},1032,["class"])):N("",!0),r(H,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"translate-y-1 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-1 opacity-0"},{default:p(()=>[r(o(W),{class:"absolute z-20 px-4 mt-3 transform sm:px-0 w-screen max-w-full left-0 top-3"},{default:p(({close:A})=>[n("div",Z,[n("div",ee,[n("div",te,[r(M,{modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=f=>c.value=f),placeholder:a.$t("general.search"),type:"text",class:"text-black"},null,8,["modelValue","placeholder"])]),o(_).length>0?(l(),i("div",se,[(l(!0),i(C,null,q(o(_),(f,b)=>(l(),i("div",{key:b,tabindex:"2",class:"px-6 py-4 border-b border-gray-200 border-solid cursor-pointer hover:bg-gray-100 hover:cursor-pointer last:border-b-0",onClick:ce=>z(b,A)},[n("div",ae,[n("label",ne,m(f.name),1)])],8,oe))),128))])):(l(),i("div",le,[n("label",re,m(a.$t("general.no_note_found")),1)]))]),o(y).hasAbilities(o(B).MANAGE_NOTE)?(l(),i("button",{key:0,type:"button",class:"h-10 flex items-center justify-center w-full px-2 py-3 bg-gray-200 border-none outline-none",onClick:j},[r(v,{name:"CheckCircleIcon",class:"text-primary-400"}),n("label",ie,m(a.$t("settings.customization.notes.add_new_note")),1)])):N("",!0)])]),_:1})]),_:1})]),_:1})])],64)}}};export{fe as _};
var E=Object.defineProperty;var b=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var g=(s,t,e)=>t in s?E(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,x=(s,t)=>{for(var e in t||(t={}))P.call(t,e)&&g(s,e,t[e]);if(b)for(var e of b(t))T.call(t,e)&&g(s,e,t[e]);return s};import{i as k,g as F,k as L,r as w,o as l,c as i,b as r,t as n,w as p,y as o,s as O,v as D,x as m,z as U,a6 as G,A as N,T as H,a7 as W,F as C,H as q,a8 as J}from"./vendor.e9042f2c.js";import{g as K,r as Q,d as R,e as B}from"./main.9d655092.js";import{_ as X}from"./NoteModal.4c55688d.js";const Y={class:"w-full"},Z={class:"overflow-hidden rounded-md shadow-lg ring-1 ring-black ring-opacity-5"},ee={class:"relative grid bg-white"},te={class:"relative p-4"},se={key:0,class:"relative flex flex-col overflow-auto list max-h-36"},oe=["onClick"],ae={class:"flex justify-between px-2"},ne={class:"m-0 text-base font-semibold leading-tight text-gray-700 cursor-pointer"},le={key:1,class:"flex justify-center p-5 text-gray-400"},re={class:"text-base text-gray-500"},ie={class:"m-0 ml-3 text-sm leading-none cursor-pointer font-base text-primary-400"},fe={props:{type:{type:String,default:null}},emits:["select"],setup(s,{emit:t}){const e=s;k(null);const{t:I}=F(),c=k(null),S=K(),d=Q(),y=R(),_=L(()=>c.value?d.notes.filter(function(a){return a.name.toLowerCase().indexOf(c.value.toLowerCase())!==-1}):d.notes);async function V(){await d.fetchNotes({filter:{},orderByField:"",orderBy:"",type:e.type?e.type:""})}function z(a,u){t("select",x({},d.notes[a])),c.value=null,u()}function j(){S.openModal({title:I("settings.customization.notes.add_note"),componentName:"NoteModal",size:"lg",data:e.type})}return(a,u)=>{const v=w("BaseIcon"),M=w("BaseInput");return l(),i(C,null,[r(X),n("div",Y,[r(o(J),null,{default:p(({isOpen:$})=>[o(y).hasAbilities(o(B).VIEW_NOTE)?(l(),O(o(G),{key:0,class:U([$?"":"text-opacity-90","flex items-center z-10 font-medium text-primary-400 focus:outline-none focus:border-none"]),onClick:V},{default:p(()=>[r(v,{name:"PlusIcon",class:"w-4 h-4 font-medium text-primary-400"}),D(" "+m(a.$t("general.insert_note")),1)]),_:2},1032,["class"])):N("",!0),r(H,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"translate-y-1 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-1 opacity-0"},{default:p(()=>[r(o(W),{class:"absolute z-20 px-4 mt-3 transform sm:px-0 w-screen max-w-full left-0 top-3"},{default:p(({close:A})=>[n("div",Z,[n("div",ee,[n("div",te,[r(M,{modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=f=>c.value=f),placeholder:a.$t("general.search"),type:"text",class:"text-black"},null,8,["modelValue","placeholder"])]),o(_).length>0?(l(),i("div",se,[(l(!0),i(C,null,q(o(_),(f,h)=>(l(),i("div",{key:h,tabindex:"2",class:"px-6 py-4 border-b border-gray-200 border-solid cursor-pointer hover:bg-gray-100 hover:cursor-pointer last:border-b-0",onClick:ce=>z(h,A)},[n("div",ae,[n("label",ne,m(f.name),1)])],8,oe))),128))])):(l(),i("div",le,[n("label",re,m(a.$t("general.no_note_found")),1)]))]),o(y).hasAbilities(o(B).MANAGE_NOTE)?(l(),i("button",{key:0,type:"button",class:"h-10 flex items-center justify-center w-full px-2 py-3 bg-gray-200 border-none outline-none",onClick:j},[r(v,{name:"CheckCircleIcon",class:"text-primary-400"}),n("label",ie,m(a.$t("settings.customization.notes.add_new_note")),1)])):N("",!0)])]),_:1})]),_:1})]),_:1})])],64)}}};export{fe as _};

Some files were not shown because too many files have changed in this diff Show More