@liiift-studio/sales-portal 3.1.5 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/Sales.js
CHANGED
|
@@ -706,56 +706,53 @@ export default function Sales(props) {
|
|
|
706
706
|
const portalIndex = allPortals.indexOf(currentPortal) + 1;
|
|
707
707
|
|
|
708
708
|
style.textContent = `
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
page-break-inside: avoid;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
709
|
+
@media print {
|
|
710
|
+
@page { size: letter portrait; margin: 0.5in; }
|
|
711
|
+
body { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
|
|
712
|
+
|
|
713
|
+
/* Hide site chrome and other portals */
|
|
714
|
+
header, nav, footer, #navBar, #footer, #titleContainer,
|
|
715
|
+
.exportSection, .date-range-sales-table-wrapper,
|
|
716
|
+
.salesPortal:not(:nth-child(${portalIndex})) { display: none !important; }
|
|
717
|
+
|
|
718
|
+
/* Hide interactive controls */
|
|
719
|
+
.MuiIconButton-root, .MuiInput-root, .MuiDateCalendar-root,
|
|
720
|
+
.print-button, .MuiFilledInput-root, .MuiFormControl-root { display: none !important; }
|
|
721
|
+
|
|
722
|
+
/* Portal layout */
|
|
723
|
+
.salesPortal, .salesPortalWrap { background: white !important; padding: 0 !important; width: 100% !important; }
|
|
724
|
+
|
|
725
|
+
/* Full width sections */
|
|
726
|
+
.sales-header-section, .sales-data-section, .insights-wrapper, .sales-table-wrapper,
|
|
727
|
+
.sales-chart-wrapper, .year-overview-wrapper, .typeface-list-wrapper,
|
|
728
|
+
.license-type-list-wrapper, .top-performers-wrapper { width: 100% !important; padding: 0 !important; margin: 10px 0 !important; }
|
|
729
|
+
|
|
730
|
+
/* Page break control */
|
|
731
|
+
.insights-wrapper, .top-performers-wrapper, .typeface-list-wrapper,
|
|
732
|
+
.license-type-list-wrapper, .sales-table-wrapper { page-break-inside: avoid; break-inside: avoid; }
|
|
733
|
+
|
|
734
|
+
/* Prevent cutting elements across pages */
|
|
735
|
+
.MuiPaper-root, tr, .designers-section > div,
|
|
736
|
+
.top-performers-section > div, .product-section > div { page-break-inside: avoid; break-inside: avoid; }
|
|
737
|
+
|
|
738
|
+
/* Insight cards: keep dark bg with white text */
|
|
739
|
+
.insights-wrapper .MuiPaper-root { background-color: #000 !important; color: white !important; border: none !important; box-shadow: none !important; }
|
|
740
|
+
.insights-wrapper .MuiTypography-root { color: inherit !important; }
|
|
741
|
+
|
|
742
|
+
/* Other text: black on white */
|
|
743
|
+
.sales-header-section .MuiTypography-root, .typeface-list-wrapper .MuiTypography-root,
|
|
744
|
+
.license-type-list-wrapper .MuiTypography-root, .sales-table-wrapper .MuiTypography-root { color: black !important; }
|
|
745
|
+
|
|
746
|
+
/* Section header bars: keep dark bg */
|
|
747
|
+
.designers-section .MuiTypography-h5, .top-performers-section .MuiTypography-h5,
|
|
748
|
+
.product-section .MuiTypography-h5 { color: white !important; }
|
|
749
|
+
|
|
750
|
+
/* Charts: ensure visible */
|
|
751
|
+
.sales-chart-wrapper, .year-overview-wrapper { max-height: 400px !important; overflow: hidden !important; page-break-inside: avoid; }
|
|
752
|
+
|
|
753
|
+
/* Compact tables */
|
|
754
|
+
.MuiTableCell-root { padding: 4px 8px !important; font-size: 10px !important; }
|
|
755
|
+
}
|
|
759
756
|
`;
|
|
760
757
|
document.head.appendChild(style);
|
|
761
758
|
|
|
@@ -196,7 +196,7 @@ export default function TopPerformers({
|
|
|
196
196
|
|
|
197
197
|
{/* Individual typefaces for this designer */}
|
|
198
198
|
{typefaceData
|
|
199
|
-
?.filter(typeface => typeface.author
|
|
199
|
+
?.filter(typeface => typeface.author?._id === designer._id)
|
|
200
200
|
.map((typeface, j) => (
|
|
201
201
|
<Typography
|
|
202
202
|
key={`designer-typeface-${i}-${j}`}
|
|
@@ -209,7 +209,7 @@ export default function TopPerformers({
|
|
|
209
209
|
}}>
|
|
210
210
|
{typeface.title}
|
|
211
211
|
<span className={styles.earningContainer}>
|
|
212
|
-
<strong> {(typeface.total / (total + chartState
|
|
212
|
+
<strong> {(typeface.total / (total + (chartState?.refundTotal || 0))).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</strong>%
|
|
213
213
|
</span>
|
|
214
214
|
<span style={{ opacity: "0.5", textTransform: "none" }}> ({typeface.orders} Orders for a total of </span>
|
|
215
215
|
<span style={{ opacity: "0.5" }}> USD</span>$<strong>{(typeface.total / 100).toLocaleString('en-US', { minimumFractionDigits: 2 })}</strong>
|
package/package.json
CHANGED
|
@@ -446,6 +446,7 @@ export function processDesignersData(typefaceData) {
|
|
|
446
446
|
let designersData = [];
|
|
447
447
|
|
|
448
448
|
typefaceData?.forEach(typeface => {
|
|
449
|
+
if (!typeface.author?._id) return;
|
|
449
450
|
let designer = designersData.find(author => author._id === typeface.author._id);
|
|
450
451
|
if (designer) {
|
|
451
452
|
designer.total += typeface.total;
|