Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/pay credits v2 #503

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions app/Domains/Transaction/Services/ReconciliationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ public function listHistoryOf(Account $account)
'account_id' => $account->id,
])
->orderByDesc('date')
->orderByDesc('id')
->get();
}

public function create(Account $account, ReconciliationParamsData $params)
{
$transactions = $account->transactionsToReconcile(null, $params->date);

// if (!count($transactions)) {
// throw new Exception("no transactions matched");
// }
if ($dateReconciliation = $this->getByDate($account->team_id, $account->id, $params->date)) {
$this->update($dateReconciliation, $params);
return $dateReconciliation;
}

$diff = $account->balance - $params->balance;
$reconciliation = Reconciliation::create([
Expand Down Expand Up @@ -141,4 +143,13 @@ public function checkOpenReconciliation(Account $account, Transaction|CoreTransa

return $this->syncTransactions($reconciliation);
}

public function getByDate($teamId, $accountId, $date) {
return Reconciliation::where([
'team_id' => $teamId,
'account_id' => $accountId,
'date' => $date
])
->first();
}
}
58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,68 +39,68 @@
},
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/config-conventional": "^19.6.0",
"@headlessui/vue": "^1.7.23",
"@iconify-json/clarity": "^1.2.1",
"@iconify-json/fluent": "^1.2.4",
"@iconify-json/fluent": "^1.2.8",
"@iconify-json/ic": "^1.2.1",
"@iconify-json/ion": "^1.2.1",
"@iconify-json/material-symbols": "^1.2.5",
"@iconify-json/material-symbols": "^1.2.8",
"@iconify-json/mdi": "^1.2.1",
"@inertiajs/vue3": "^1.2.0",
"@mertasan/tailwindcss-variables": "^2.7.0",
"@tailwindcss/typography": "^0.5.15",
"@vitejs/plugin-vue": "^5.1.4",
"@vueuse/core": "^11.1.0",
"@vitejs/plugin-vue": "^5.2.1",
"@vueuse/core": "^11.3.0",
"atmosphere-ui": "^1.4.1",
"autoprefixer": "^10.4.20",
"axios": "^1.7.7",
"axios": "^1.7.8",
"commit-and-tag-version": "^12.5.0",
"date-fns": "^4.1.0",
"eslint": "^9.13.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-html": "^8.1.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.29.1",
"eslint-plugin-vue": "^9.31.0",
"exact-math": "^2.2.3",
"husky": "^9.1.6",
"laravel-vite-plugin": "^1.0.5",
"laravel-vite-plugin": "^1.0.6",
"lodash": "^4.17.21",
"naive-ui": "^2.40.1",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"sass": "^1.80.3",
"naive-ui": "^2.40.2",
"postcss": "^8.4.49",
"prettier": "^3.4.1",
"sass": "^1.81.0",
"slug": "^10.0.0",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3",
"unplugin-icons": "^0.19.3",
"unplugin-vue-components": "^0.27.4",
"uuid": "^10.0.0",
"tailwindcss": "^3.4.15",
"typescript": "^5.7.2",
"unplugin-icons": "^0.20.2",
"unplugin-vue-components": "^0.27.5",
"uuid": "^11.0.3",
"vite": "^5.4.9",
"vite-plugin-pwa": "^0.20.5",
"vitepress": "^1.4.1",
"vue": "^3.5.12",
"vite-plugin-pwa": "^0.21.0",
"vitepress": "^1.5.0",
"vue": "^3.5.13",
"vue-multiselect": "^3.1.0",
"vue3-apexcharts": "^1.7.0",
"vue3-apexcharts": "^1.8.0",
"vueuse-temporals": "^1.6.0"
},
"dependencies": {
"@formkit/auto-animate": "^1.0.0-beta.1",
"@originjs/vite-plugin-federation": "^1.3.6",
"@vueuse/components": "^11.1.0",
"@vueuse/components": "^11.3.0",
"apexcharts": "^3.54.1",
"chart.js": "^4.4.5",
"element-plus": "^2.8.6",
"chart.js": "^4.4.6",
"element-plus": "^2.8.8",
"floating-vue": "^5.2.2",
"fuse.js": "^7.0.0",
"luxon": "^3.5.0",
"pinia": "^2.2.4",
"pinia": "^2.2.8",
"randomcolor": "^0.6.2",
"vanilla-icon-picker": "^1.3.1",
"vite-plugin-vue-devtools": "^7.5.2",
"vue-chartjs": "^5.3.1",
"vite-plugin-vue-devtools": "^7.6.7",
"vue-chartjs": "^5.3.2",
"vue-draggable-next": "^2.2.1",
"vue-i18n": "^9.14.1",
"vue-i18n": "^9.14.2",
"vue-temporal-components": "^1.2.1"
},
"author": {
Expand Down
44 changes: 23 additions & 21 deletions resources/js/Pages/Finance/Account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,21 @@ const setPaymentBill = (transaction: ITransaction) => {
})
}

const financeTabs = [{
const financeTabs = computed(() => {

return [{
name: "transactions",
label: "Transactions",
label: `Transactions ${props.transactions.length}`,
},
// {
// name: "trends",
// label: "Trends",
// }
];
{
name: "trends",
label: "Trends",
}
];
});

const selectedTabName = computed(() => {
return `All transactions ${monthName.value}`;
return `All transactions in ${monthName.value}`;
})

</script>
Expand Down Expand Up @@ -283,26 +286,25 @@ const selectedTabName = computed(() => {
default-tab="transactions"
class="mt-4"
>
<template #title>
<header class="flex space-x-2 pl-4 items-center justify-between py-2 w-full">
<AppSearch
v-model.lazy="pageState.search"
class="w-full md:flex "
:has-filters="hasFilters"
@clear="reset()"
:placeholder="selectedTabName"
/>

</header>
</template>
<template v-slot:content="{ selectedTab }">
<section class="bg-base-lvl-3">
<header class="flex space-x-2 items-center justify-between py-2">
<AppSearch
v-model.lazy="pageState.search"
class="w-full md:flex "
:has-filters="hasFilters"
@clear="reset()"
/>

<span class="min-w-fit text-secondary font-bold">
{{ transactions.length }} Results
</span>
</header>
<AccountReconciliationBanner
v-if="selectedAccount"
:account="selectedAccount"
/>


<Component
:is="listComponent"
:cols="tableAccountCols(props.accountId)"
Expand Down
1 change: 1 addition & 0 deletions resources/js/Pages/Finance/Partials/FinanceTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
class="w-full overflow-hidden md:pr-5 md:pl-8"
:class="!hidePanel && 'md:w-6/12 lg:w-7/12 xl:w-8/12 2xl:w-10/12'"
>
<slot name="prepend-panel" v-if="hidePanel" />
<slot />
</main>

Expand Down
6 changes: 3 additions & 3 deletions resources/js/Pages/Finance/Transactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ const goToAccount = (accountId: number) => {
<FinanceTemplate
title="Transactions"
:accounts="accounts"
hide-panel
:hide-panel="!context.isMobile"
:force-show-panel="context.isMobile && !showTransactionTable"
>
<template #prepend-panel v-if="context.isMobile">
<template #prepend-panel v-if="context.isMobile" >
<button
v-ripple
class="flex items-center justify-between w-full px-4 py-3 font-bold text-body-1 bg-base-lvl-3"
Expand All @@ -200,7 +201,6 @@ const goToAccount = (accountId: number) => {

<main class="mt-4 ">
<header class="flex bg-base-lvl-3 justify-between px-6 py-2">

<section class="flex space-x-2 items-center">
<StatusButtons
v-model="currentStatus"
Expand Down
Loading