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

SPD-105 - fix: changed the path file for the logo & fixed the ± symbo… #51

Merged
merged 1 commit into from
Jun 23, 2024
Merged
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
12 changes: 6 additions & 6 deletions src/javascript/reports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
async function downloadPDF() {
const { jsPDF } = window.jspdf;
const logo = "images/sweet-avenue-logo.png";
const logo = "images/logo-removebg-preview.png";

// Create a new PDF document
const doc = new jsPDF();
Expand Down Expand Up @@ -44,7 +44,7 @@ async function downloadPDF() {
doc.text("Sales Today:", 15, 60);
doc.setFont("Helvetica", "bold");
doc.setTextColor("#88531E");
doc.text(`${todaySale}`, 80, 60);
doc.text(`${todaySale}`, 80, 60);

doc.setFont("Helvetica", "normal");
doc.setTextColor("#000000");
Expand All @@ -58,7 +58,7 @@ async function downloadPDF() {
doc.text("Weekly Sales:", 15, 80);
doc.setFont("Helvetica", "bold");
doc.setTextColor("#88531E");
doc.text(`${weeklySale}`, 80, 80);
doc.text(`${weeklySale}`, 80, 80);
doc.setFont("Helvetica", "semibold");
doc.text(`(${weekDuration})`, 15, 85);

Expand All @@ -67,7 +67,7 @@ async function downloadPDF() {
doc.text("Monthly Sales:", 15, 90);
doc.setFont("Helvetica", "bold");
doc.setTextColor("#88531E");
doc.text(`${monthlySale}`, 80, 90);
doc.text(`${monthlySale}`, 80, 90);
doc.setFont("Helvetica", "semibold");
doc.text(`(${dateRange})`, 15, 95);

Expand All @@ -80,7 +80,7 @@ async function downloadPDF() {
const weeklySalesHeaders = ["Date", "Sales"];
const weeklySalesDataFormatted = weeklySalesData.map((entry) => [
entry.date,
`${parseFloat(entry.total_sales).toFixed(2)}`,
`${parseFloat(entry.total_sales).toFixed(2)}`,
]);

// Weekly Sales Table Styling
Expand Down Expand Up @@ -126,7 +126,7 @@ async function downloadPDF() {
const predictedWeeklySalesData = predictedSalesData.predictions.map(
(prediction) => [
prediction.date,
`${prediction.sales_prediction.toFixed(2)}`,
`${prediction.sales_prediction.toFixed(2)}`,
]
);

Expand Down
Loading