summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-03 14:47:54 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-03 14:47:54 +0700
commit1d22b4349b8c7d1b5c62643ffd4146662cf0033e (patch)
tree1498f7c121328ca9e1de3d1e4a15e570ab90ed2d
parentd4d4227dfb2fefa56ded8ff5897469459f56b069 (diff)
download invoice
-rw-r--r--src/pages/my/invoice/[id].js18
-rw-r--r--src/pages/shop/product/[slug].js2
-rw-r--r--src/styles/globals.css1
3 files changed, 18 insertions, 3 deletions
diff --git a/src/pages/my/invoice/[id].js b/src/pages/my/invoice/[id].js
index d13cf7a6..cc66fd22 100644
--- a/src/pages/my/invoice/[id].js
+++ b/src/pages/my/invoice/[id].js
@@ -47,7 +47,11 @@ export default function DetailInvoice() {
};
const downloadTaxInvoice = () => {
- window.open(`${process.env.ODOO_HOST}/api/v1/download/tax-invoice/${invoice.id}/${invoice.efaktur_token}`, '_blank')
+ window.open(`${process.env.ODOO_HOST}/api/v1/download/tax-invoice/${invoice.id}/${invoice.token}`, '_blank')
+ }
+
+ const downloadInvoice = () => {
+ window.open(`${process.env.ODOO_HOST}/api/v1/download/invoice/${invoice.id}/${invoice.token}`, '_blank')
}
return (
@@ -86,12 +90,22 @@ export default function DetailInvoice() {
{ invoice?.invoice_date }
</DescriptionRow>
<div className="flex items-center">
+ <p className="text-gray_r-11 leading-none">Faktur Pembelian</p>
+ <button
+ type="button"
+ className="btn-solid-red py-1 px-2 ml-auto"
+ onClick={downloadInvoice}
+ >
+ Download
+ </button>
+ </div>
+ <div className="flex items-center">
<p className="text-gray_r-11 leading-none">Faktur Pajak</p>
<button
type="button"
className="btn-solid-red py-1 px-2 ml-auto"
onClick={downloadTaxInvoice}
- disabled={invoice.efaktur_token ? false : true}
+ disabled={invoice.efaktur ? false : true}
>
Download
</button>
diff --git a/src/pages/shop/product/[slug].js b/src/pages/shop/product/[slug].js
index 281f2bc2..03fac0be 100644
--- a/src/pages/shop/product/[slug].js
+++ b/src/pages/shop/product/[slug].js
@@ -190,7 +190,7 @@ export default function ProductDetail({ product }) {
{product.lowest_price.discount_percentage > 0 ? (
<div className="flex gap-x-1 items-center mb-1">
<p className="text-caption-2 text-gray_r-11 line-through">{currencyFormat(activeVariant.price.price)}</p>
- <span className="badge-red">{activeVariant.price.discount_percentage}%</span>
+ <span className="badge-solid-red">{activeVariant.price.discount_percentage}%</span>
</div>
) : ''}
diff --git a/src/styles/globals.css b/src/styles/globals.css
index ec603157..0a1b7a3d 100644
--- a/src/styles/globals.css
+++ b/src/styles/globals.css
@@ -196,6 +196,7 @@ html, body {
text-gray_r-1
disabled:text-gray_r-1
disabled:bg-red_r-8
+ disabled:border-red_r-8
;
}