Omit transaction equipment counting component and simply use transaction.length

This commit is contained in:
Keannu Bernasol 2024-01-11 08:37:11 +08:00
parent 01e74a79de
commit c80908d8f1
2 changed files with 2 additions and 14 deletions

View file

@ -1,7 +1,6 @@
import { Document, Page, Text, View, Image } from "@react-pdf/renderer";
import { TransactionListType } from "../Types/Types";
import { colors } from "../../styles";
import count_transaction_equipments from "../../CountTransactionEquipments/CountTransactionEquipments";
import {
filter_today,
filter_thismonth,
@ -148,8 +147,7 @@ export default function TransactionReportPDF(props: props) {
}}
>
{" "}
Total Equipments Processed:{" "}
{count_transaction_equipments(transactions_today)}
Total Equipments Processed: {transactions_today.length}
</Text>
<Text
@ -214,8 +212,7 @@ export default function TransactionReportPDF(props: props) {
}}
>
{" "}
Total Equipments Processed:{" "}
{count_transaction_equipments(transactions_thismonth)}
Total Equipments Processed: {transactions_thismonth.length}
</Text>
<Text

View file

@ -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;
}