mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2024-11-17 06:19:27 +08:00
Omit transaction equipment counting component and simply use transaction.length
This commit is contained in:
parent
01e74a79de
commit
c80908d8f1
2 changed files with 2 additions and 14 deletions
|
@ -1,7 +1,6 @@
|
||||||
import { Document, Page, Text, View, Image } from "@react-pdf/renderer";
|
import { Document, Page, Text, View, Image } from "@react-pdf/renderer";
|
||||||
import { TransactionListType } from "../Types/Types";
|
import { TransactionListType } from "../Types/Types";
|
||||||
import { colors } from "../../styles";
|
import { colors } from "../../styles";
|
||||||
import count_transaction_equipments from "../../CountTransactionEquipments/CountTransactionEquipments";
|
|
||||||
import {
|
import {
|
||||||
filter_today,
|
filter_today,
|
||||||
filter_thismonth,
|
filter_thismonth,
|
||||||
|
@ -148,8 +147,7 @@ export default function TransactionReportPDF(props: props) {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
• Total Equipments Processed:{" "}
|
• Total Equipments Processed: {transactions_today.length}
|
||||||
{count_transaction_equipments(transactions_today)}
|
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
|
@ -214,8 +212,7 @@ export default function TransactionReportPDF(props: props) {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
• Total Equipments Processed:{" "}
|
• Total Equipments Processed: {transactions_thismonth.length}
|
||||||
{count_transaction_equipments(transactions_thismonth)}
|
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
import { TransactionListType } from "../Components/Types/Types";
|
|
||||||
|
|
||||||
export default function count_transaction_equipments(
|
|
||||||
transactions: TransactionListType
|
|
||||||
) {
|
|
||||||
let n = 0;
|
|
||||||
transactions.forEach((transaction) => (n += transaction.equipments.length));
|
|
||||||
return n;
|
|
||||||
}
|
|
Loading…
Reference in a new issue