Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrafei committed Jul 18, 2021
1 parent 1e8fdaf commit 966c606
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vitrin-pos",
"productName": "vitrin-pos",
"version": "0.9.0",
"version": "0.9.1",
"description": "Application for vitrin POS",
"license": "Vitrin",
"private": false,
Expand Down
18 changes: 9 additions & 9 deletions src/containers/EditProduct/InfoTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function InfoTable({ product, setProduct }) {
setProduct({
...product,
extra_data: {
extra_data: product.extra_data,
...product.extra_data,
info_table: newProductInfoTable,
},
});
Expand Down Expand Up @@ -112,14 +112,14 @@ export default function InfoTable({ product, setProduct }) {
newProductInfoTable.splice(index + 1, 0, {
key: "",
value: "",
}),
setProduct({
...product,
extra_data: {
...product.extra_data,
info_table: newProductInfoTable,
},
});
});
setProduct({
...product,
extra_data: {
...product.extra_data,
info_table: newProductInfoTable,
},
});
}}
edge="end"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export default class ReportPrintComponent extends React.Component {
className="u-border-radius-8 text-center u-border-black p-3"
style={{ minWidth: 105 }}
>
{printOptions.date && printOptions.date.from}
{printOptions.date && printOptions.date.from_date}
</span>
<span>{business.revised_title}</span>
<span
className="u-border-radius-8 text-center u-border-black p-3"
style={{ minWidth: 105 }}
>
{printOptions.date && printOptions.date.to}
{printOptions.date && printOptions.date.to_date}
</span>
</div>
<div className="d-flex flex-column justify-content-between px-3 pb-1">
Expand Down
28 changes: 14 additions & 14 deletions src/containers/OrdersReport/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ const OrdersReport = function ({
const [modalOpen, setModalOpen] = useState(false);
const [toCalenderOpen, setToCalenderOpen] = useState(false);
const [fromCalenderOpen, setFromCalenderOpen] = useState(false);
const [query, setQuery] = useState({ to: "", from: "" });
const [query, setQuery] = useState({ to_date: "", from_date: "" });

const page = getQueryParams("page", location.search) || 1;
const toTime = moment(query.to, "jYYYY/jMM/jDD").format("YYYY-MM-DD");
const fromTime = moment(query.from, "jYYYY/jMM/jDD").format("YYYY-MM-DD");
const toTime = moment(query.to_date, "jYYYY/jMM/jDD").format("YYYY-MM-DD");
const fromTime = moment(query.from_date, "jYYYY/jMM/jDD").format("YYYY-MM-DD");

useEffect(() => {
submit();
Expand All @@ -66,8 +66,8 @@ const OrdersReport = function ({
const submit = useCallback(() => {
const params = { page };
if (query) {
if (query.to) params.to = toTime;
if (query.from) params.from = fromTime;
if (query.to_date) params.to_date = toTime;
if (query.from_date) params.from_date = fromTime;
}
_getAdminOrders(params);
}, [query, location]);
Expand All @@ -79,12 +79,12 @@ const OrdersReport = function ({
<CalenderModal
open={toCalenderOpen}
onClose={() => setToCalenderOpen(false)}
selectDay={(day) => setQuery({ ...query, to: day })}
selectDay={(day) => setQuery({ ...query, to_date: day })}
/>
<CalenderModal
open={fromCalenderOpen}
onClose={() => setFromCalenderOpen(false)}
selectDay={(day) => setQuery({ ...query, from: day })}
selectDay={(day) => setQuery({ ...query, from_date: day })}
/>
<FactorModal
business={business}
Expand All @@ -96,9 +96,9 @@ const OrdersReport = function ({
printers={printOptions.printers}
report={report}
date={{
to: query.to ? englishNumberToPersianNumber(query.to) : "--/--/--",
from: query.from
? englishNumberToPersianNumber(query.from)
to_date: query.to_date ? englishNumberToPersianNumber(query.to_date) : "--/--/--",
from_date: query.from_date
? englishNumberToPersianNumber(query.from_date)
: "--/--/--",
}}
/>
Expand All @@ -110,7 +110,7 @@ const OrdersReport = function ({
>
از تاریخ
<span className="mr-2">
{query.from ? englishNumberToPersianNumber(query.from) : "----"}
{query.from_date ? englishNumberToPersianNumber(query.from_date) : "----"}
</span>
<Icon icon={ICONS.CONTROL_DOWN} size={25} color="#001e2d" />
</div>
Expand All @@ -120,7 +120,7 @@ const OrdersReport = function ({
>
تا تاریخ
<span className="mr-2">
{query.to ? englishNumberToPersianNumber(query.to) : "----"}
{query.to_date ? englishNumberToPersianNumber(query.to_date) : "----"}
</span>
<Icon icon={ICONS.CONTROL_DOWN} size={25} color="#001e2d" />
</div>
Expand All @@ -129,8 +129,8 @@ const OrdersReport = function ({
<div
onClick={() => {
const params = {};
if (query.to) params.to = toTime;
if (query.from) params.from = fromTime;
if (query.to_date) params.to_date = toTime;
if (query.from_date) params.from_date = fromTime;
_getOrdersReport(params);
setModalOpen(true);
}}
Expand Down
2 changes: 1 addition & 1 deletion utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const GET_ORDER_TRANSACTION_API = (id) =>
export const TRANSACTION_ZIBAL_API = (id) =>
`${BASE_URL}order_transactions/${id}/pay_transaction/`;
export const TRANSACTION_API = (id, gateway) =>
`${BASE_URL}transactions/${id}/${gateway}_gateway`;
`${BASE_URL}transactions/${id}/${gateway}_gateway/`;

export const REPORTS_API = `${BASE_URL}shopping_orders/report/`;
export const GROUP_PACKAGING_PRICE_ON_DEALS_API = (id) =>
Expand Down

0 comments on commit 966c606

Please sign in to comment.