mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat : header api.
This commit is contained in:
@@ -30,14 +30,14 @@ function CustomersBalanceSummary({
|
||||
}) {
|
||||
|
||||
const [filter, setFilter] = useState({
|
||||
asDate: moment().endOf('day').format('YYYY-MM-DD'),
|
||||
as_date: moment().endOf('day').format('YYYY-MM-DD'),
|
||||
});
|
||||
|
||||
// Handle re-fetch customers balance summary after filter change.
|
||||
const handleFilterSubmit = (filter) => {
|
||||
const _filter = {
|
||||
...filter,
|
||||
asDate: moment(filter.asDate).format('YYYY-MM-DD'),
|
||||
as_date: moment(filter.as_date).format('YYYY-MM-DD'),
|
||||
};
|
||||
setFilter({ ..._filter });
|
||||
};
|
||||
|
||||
@@ -29,13 +29,13 @@ function CustomersBalanceSummaryHeader({
|
||||
|
||||
// validation schema.
|
||||
const validationSchema = Yup.object().shape({
|
||||
asDate: Yup.date().required().label('asDate'),
|
||||
as_date: Yup.date().required().label('asDate'),
|
||||
});
|
||||
|
||||
// filter form initial values.
|
||||
const initialValues = {
|
||||
...pageFilter,
|
||||
asDate: moment(pageFilter.asDate).toDate(),
|
||||
as_date: moment(pageFilter.as_date).toDate(),
|
||||
};
|
||||
|
||||
// handle form submit.
|
||||
|
||||
@@ -298,6 +298,9 @@ export function useCustomerBalanceSummaryReport(query, props) {
|
||||
method: 'get',
|
||||
url: '/financial_statements/customer-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
@@ -324,12 +327,16 @@ export function useVendorsBalanceSummaryReport(query, props) {
|
||||
method: 'get',
|
||||
url: '/financial_statements/vendor-balance-summary',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
select: (res) => ({
|
||||
columns: res.data.columns,
|
||||
query: res.data.query,
|
||||
tableRows: res.data.table.rows,
|
||||
tableRows: res.data.table.data,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
@@ -350,6 +357,9 @@ export function useCustomersTranscationsReport(query, props) {
|
||||
method: 'get',
|
||||
url: '/financial_statements/transactions-by-customers',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
@@ -364,3 +374,31 @@ export function useCustomersTranscationsReport(query, props) {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve vendors transcations report.
|
||||
*/
|
||||
export function useVendorsTranscationsReport(query, props) {
|
||||
return useRequestQuery(
|
||||
[t.FINANCIAL_REPORT, t.VENDORS_TRANSACTIONS, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: '/financial_statements/transactions-by-vendors',
|
||||
params: query,
|
||||
headers: {
|
||||
Accept: 'application/json+table',
|
||||
},
|
||||
},
|
||||
{
|
||||
select: (res) => ({
|
||||
data: res.data.table,
|
||||
tableRows: res.data.table.data,
|
||||
}),
|
||||
defaultData: {
|
||||
tableRows: [],
|
||||
data: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1055,6 +1055,12 @@ export default {
|
||||
transaction_date: 'Transaction date',
|
||||
transaction_type: 'Transaction type',
|
||||
running_balance: 'Running Balance',
|
||||
account_normal:'Account normal',
|
||||
published_at:'Published at',
|
||||
account_normal: 'Account normal',
|
||||
published_at: 'Published at',
|
||||
customers_balance_summary: 'Customers Balance Summary',
|
||||
vendors_balance_summary: 'Vendors Balance Summary',
|
||||
percentage_of_column: 'Percentage',
|
||||
customers_transactions: 'Customers Transcations',
|
||||
vendors_transactions: 'Vendors Transcations',
|
||||
reference_type: 'Reference type',
|
||||
};
|
||||
|
||||
@@ -264,11 +264,11 @@ export default [
|
||||
},
|
||||
{
|
||||
path: `/financial-reports/transactions-by-customers`,
|
||||
// component: lazy(() =>
|
||||
// import(
|
||||
// 'containers/FinancialStatements/CustomersTransactions/CustomersTransactions'
|
||||
// ),
|
||||
// ),
|
||||
component: lazy(() =>
|
||||
import(
|
||||
'containers/FinancialStatements/CustomersTransactions/CustomersTransactions'
|
||||
),
|
||||
),
|
||||
breadcrumb: 'Customers Transactions ',
|
||||
hint: '..',
|
||||
pageTitle: formatMessage({ id: 'customers_transactions' }),
|
||||
@@ -276,12 +276,12 @@ export default [
|
||||
sidebarExpand: false,
|
||||
},
|
||||
{
|
||||
path: `/financial-reports/vendors-transactions`,
|
||||
// component: lazy(() =>
|
||||
// import(
|
||||
// 'containers/FinancialStatements/'
|
||||
// ),
|
||||
// ),
|
||||
path: `/financial-reports/transactions-by-vendors`,
|
||||
component: lazy(() =>
|
||||
import(
|
||||
'containers/FinancialStatements/VendorsTransactions/VendorsTransactions'
|
||||
),
|
||||
),
|
||||
breadcrumb: 'Vendors Transactions ',
|
||||
hint: '..',
|
||||
pageTitle: formatMessage({ id: 'vendors_transactions' }),
|
||||
|
||||
@@ -129,12 +129,11 @@ export function toggleInventoryValuationFilterDrawer(toggle) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Toggles display of the customers balance summary filter drawer.
|
||||
* @param {boolean} toggle
|
||||
*/
|
||||
export function toggleCustomersBalanceSummaryFilterDrawer(toggle) {
|
||||
export function toggleCustomersBalanceSummaryFilterDrawer(toggle) {
|
||||
return {
|
||||
type: `${t.CUSTOMERS_BALANCE_SUMMARY}/${t.DISPLAY_FILTER_DRAWER_TOGGLE}`,
|
||||
payload: {
|
||||
@@ -146,7 +145,7 @@ export function toggleInventoryValuationFilterDrawer(toggle) {
|
||||
* Toggles display of the vendors balance summary filter drawer.
|
||||
* @param {boolean} toggle
|
||||
*/
|
||||
export function toggleVendorsBalanceSummaryFilterDrawer(toggle) {
|
||||
export function toggleVendorsBalanceSummaryFilterDrawer(toggle) {
|
||||
return {
|
||||
type: `${t.VENDORS_BALANCE_SUMMARY}/${t.DISPLAY_FILTER_DRAWER_TOGGLE}`,
|
||||
payload: {
|
||||
@@ -158,7 +157,7 @@ export function toggleInventoryValuationFilterDrawer(toggle) {
|
||||
* Toggles display of the customers transactions filter drawer.
|
||||
* @param {boolean} toggle
|
||||
*/
|
||||
export function toggleCustomersTransactionsFilterDrawer(toggle) {
|
||||
export function toggleCustomersTransactionsFilterDrawer(toggle) {
|
||||
return {
|
||||
type: `${t.CUSTOMERS_TRANSACTIONS}/${t.DISPLAY_FILTER_DRAWER_TOGGLE}`,
|
||||
payload: {
|
||||
@@ -167,15 +166,15 @@ export function toggleInventoryValuationFilterDrawer(toggle) {
|
||||
};
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Toggles display of the vendors transactions filter drawer.
|
||||
// * @param {boolean} toggle
|
||||
// */
|
||||
// export function toggleVendorsTransactionsFilterDrawer(toggle) {
|
||||
// return {
|
||||
// type: `${t.VENDORS_TRANSACTIONS}/${t.DISPLAY_FILTER_DRAWER_TOGGLE}`,
|
||||
// payload: {
|
||||
// toggle,
|
||||
// },
|
||||
// };
|
||||
// }
|
||||
/**
|
||||
* Toggles display of the vendors transactions filter drawer.
|
||||
* @param {boolean} toggle
|
||||
*/
|
||||
export function toggleVendorsTransactionsFilterDrawer(toggle) {
|
||||
return {
|
||||
type: `${t.VENDORS_TRANSACTIONS}/${t.DISPLAY_FILTER_DRAWER_TOGGLE}`,
|
||||
payload: {
|
||||
toggle,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,5 +13,5 @@ export default {
|
||||
CUSTOMERS_BALANCE_SUMMARY: 'CUSTOMERS BALANCE SUMMARY',
|
||||
VENDORS_BALANCE_SUMMARY: 'VENDORS BALANCE SUMMARY',
|
||||
CUSTOMERS_TRANSACTIONS: 'CUSTOMERS TRANSACTIONS',
|
||||
// VENDORS_TRANSACTIONS: 'CUSTOMERS TRANSACTIONS',
|
||||
VENDORS_TRANSACTIONS: 'VENDORS TRANSACTIONS',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user