ordering-ui-admin-external 1.43.55 → 1.43.57

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.
@@ -0,0 +1,186 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const DriversAdvacedLogsContainer = styled.div`
4
+ height: calc(100% - 180px);
5
+ ${({ disabled }) => disabled && css`
6
+ opacity: 0.7;
7
+ pointer-events: none;
8
+ `}
9
+ `
10
+
11
+ export const TableWrapper = styled.div`
12
+ overflow: auto;
13
+ height: 100%;
14
+ `
15
+
16
+ export const SeeChanges = styled.span`
17
+ color: ${props => props.theme.colors.primary};
18
+ cursor: pointer;
19
+ &:hover {
20
+ text-decoration: underline;
21
+ }
22
+ `
23
+
24
+ export const Table = styled.table`
25
+ width: 100%;
26
+ min-width: 1000px;
27
+ color: ${props => props.theme.colors?.headingColor};
28
+
29
+ thead {
30
+ tr {
31
+ border-bottom: solid 1px ${props => props.theme.colors.disabled};
32
+ th {
33
+ padding: 13px 0;
34
+ font-size: 12px;
35
+ &:first-child {
36
+ width: 10%;
37
+ ${props => props.theme?.rtl ? css`
38
+ padding-left: 15px;
39
+ ` : css`
40
+ padding-right: 15px;
41
+ `}
42
+ box-sizing: border-box;
43
+ }
44
+ &:nth-child(2) {
45
+ width: 10%;
46
+ padding-left: 15px;
47
+ padding-right: 15px;
48
+ }
49
+ &:nth-child(3) {
50
+ width: 15%;
51
+ padding-left: 15px;
52
+ padding-right: 15px;
53
+ box-sizing: border-box;
54
+ }
55
+ &:nth-child(4) {
56
+ ${props => props.theme?.rtl ? css`
57
+ padding-right: 15px;
58
+ ` : css`
59
+ padding-left: 15px;
60
+ `}
61
+ box-sizing: border-box;
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ > tbody {
68
+ border-bottom: 1px solid ${props => props.theme.colors.borderColor};
69
+ td {
70
+ padding: 13px 0;
71
+ font-size: 12px;
72
+ &:first-child {
73
+ width: 10%;
74
+ ${props => props.theme?.rtl ? css`
75
+ padding-left: 15px;
76
+ ` : css`
77
+ padding-right: 15px;
78
+ `}
79
+ box-sizing: border-box;
80
+ }
81
+ &:nth-child(2) {
82
+ width: 10%;
83
+ padding-left: 15px;
84
+ padding-right: 15px;
85
+ }
86
+ &:nth-child(3) {
87
+ width: 15%;
88
+ padding-left: 15px;
89
+ padding-right: 15px;
90
+ }
91
+ &:nth-child(4) {
92
+ ${props => props.theme?.rtl ? css`
93
+ padding-right: 15px;
94
+ ` : css`
95
+ padding-left: 15px;
96
+ `}
97
+ box-sizing: border-box;
98
+ }
99
+ }
100
+ }
101
+ `
102
+
103
+ export const UserInfoContainer = styled.div`
104
+ p {
105
+ color: ${props => props.theme.colors.lightGray};
106
+ margin: 0px;
107
+ font-size: 12px;
108
+ &:first-child {
109
+ color: ${props => props.theme.colors.headingColor};
110
+ font-weight: 500;
111
+ }
112
+ }
113
+ `
114
+
115
+ export const DateTimeWrapper = styled.div`
116
+ white-space: nowrap;
117
+ font-size: 12px;
118
+ min-height: 36px;
119
+ display: flex;
120
+ align-items: center;
121
+
122
+ ${props => props.theme?.rtl ? css`
123
+ padding-left: 15px;
124
+ margin-left: 15px;
125
+ border-left: 1px solid ${props => props.theme.colors.borderColor};
126
+ ` : css`
127
+ padding-right: 15px;
128
+ margin-right: 15px;
129
+ border-right: 1px solid ${props => props.theme.colors.borderColor};
130
+ `}
131
+ `
132
+
133
+ export const NoData = styled.div`
134
+ font-size: 16px;
135
+ `
136
+ export const WrapperPagination = styled.div`
137
+ display: flex;
138
+ align-items: center;
139
+ padding: 20px 0;
140
+ `
141
+
142
+ export const DataListTable = styled.table`
143
+ width: 100%;
144
+ border-right: 1px solid ${props => props.theme.colors.borderColor};
145
+
146
+ tbody {
147
+ border-bottom: none;
148
+ td {
149
+ box-sizing: border-box;
150
+ &:first-child {
151
+ width: 50% !important;
152
+ padding-left: 15px;
153
+ padding-right: 15px;
154
+ box-sizing: border-box;
155
+ }
156
+ &:not(:first-child) {
157
+ width: initial !important;
158
+ }
159
+ white-space: nowrap;
160
+ padding-top: 10px;
161
+ padding-bottom: 10px;
162
+ ${props => props.theme?.rtl ? css`
163
+ padding-left: 15px;
164
+ ` : css`
165
+ padding-right: 15px;
166
+ `}
167
+ }
168
+ }
169
+ `
170
+
171
+ export const EventTypeContainer = styled.div`
172
+ white-space: nowrap;
173
+ font-size: 12px;
174
+ min-height: 36px;
175
+ display: flex;
176
+ align-items: center;
177
+ padding-right: 15px;
178
+ padding-left: 15px;
179
+ margin-left: 15px;
180
+ margin-right: 10px;
181
+ border-right: 1px solid ${props => props.theme.colors.borderColor};
182
+ border-left: 1px solid ${props => props.theme.colors.borderColor};
183
+ p{
184
+ margin-bottom: 0px;
185
+ }
186
+ `
@@ -13,6 +13,7 @@ import { UserMetaFields } from '../../Users'
13
13
  import { DriversLogs } from '../DriversLogs'
14
14
  import { DriversGroupLogsUI } from '../DriversGroupLogs'
15
15
  import { DriverGroupSetting } from '../DriverGroupSetting'
16
+ import { DriversAdvancedLogs } from '../DriversAdvancedLogs'
16
17
  import { ArrowsAngleContract, ArrowsAngleExpand, ThreeDots } from 'react-bootstrap-icons'
17
18
  import { Switch, Button, IconButton } from '../../../styles'
18
19
  import { ActionsForm } from '../UserFormDetails/styles'
@@ -207,6 +208,12 @@ export const UserDetailsUI = (props) => {
207
208
  UIComponent={DriversGroupLogsUI}
208
209
  />
209
210
  )}
211
+ {currentMenuSelected === 'advanced_logs' && (
212
+ <DriversAdvancedLogs
213
+ userId={userState.user?.id}
214
+ UIComponent={DriversGroupLogsUI}
215
+ />
216
+ )}
210
217
  {currentMenuSelected === 'orders' && (
211
218
  <OrdersManager
212
219
  isSelectedOrders
@@ -21,6 +21,7 @@ export const UserDetailsMenu = (props) => {
21
21
  { key: 'saved_places', content: t('SAVED_PLACES', 'Saved places') },
22
22
  { key: 'schedule', content: t('SCHEDULE', 'Schedule') },
23
23
  { key: 'logs', content: t('LOGS', 'Logs') },
24
+ { key: 'advanced_logs', content: t('ADVANCED_LOGS', 'Advanced logs') },
24
25
  { key: 'push_tokens', content: t('PUSH_TOKENS', 'Push tokens') }
25
26
  // { key: 'metafields', content: t('METAFIELDS', 'Metafields') },
26
27
  // { key: 'personalization', content: t('PERSONALIZATION', 'Personalization') }
@@ -17,6 +17,7 @@ import { DriversGroupBusinesses } from './DriversGroupBusinesses'
17
17
  import { DriversGroupPaymethods } from './DriversGroupPaymethods'
18
18
  import { DriversGroupLogistics } from './DriversGroupLogistics'
19
19
  import { DriversGroupLogs } from './DriversGroupLogs'
20
+ import { DriversAdvancedLogs } from './DriversAdvancedLogs'
20
21
  import { DriversGroupCompanies } from './DriversGroupCompanies'
21
22
  import { DriversGroupDrivers } from './DriversGroupDrivers'
22
23
  import { DriversGroupOrders } from './DriversGroupOrders'
@@ -46,6 +47,7 @@ export {
46
47
  DriversGroupPaymethods,
47
48
  DriversGroupLogistics,
48
49
  DriversGroupLogs,
50
+ DriversAdvancedLogs,
49
51
  DriversGroupCompanies,
50
52
  DriversGroupDrivers,
51
53
  DriversGroupOrders,
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react'
2
- import { verifyDecimals } from '../../../utils'
2
+ import { getCurrenySymbol, verifyDecimals } from '../../../utils'
3
3
  import { useUtils, useLanguage, useConfig } from 'ordering-components-admin-external'
4
4
  import { PrintContainer, PrintTextContainer, ProductComments, ProdcutCommentsContainer, Products, InfoContainer, InsideInfo2, InsideInfo, PrintProductsContainer, PrintProducts } from './styles'
5
5
 
@@ -50,8 +50,8 @@ export const OrderToPrintTicket = forwardRef((props, ref) => {
50
50
 
51
51
  const getSuboptions = (suboptions) => {
52
52
  const array = []
53
- suboptions?.length > 0 &&
54
- suboptions?.map((suboption) => {
53
+ suboptions && suboptions.length > 0 &&
54
+ suboptions.map((suboption) => {
55
55
  const string = `${getFormattedSubOptionName(suboption)}`
56
56
  array.push(string)
57
57
  })
@@ -59,11 +59,22 @@ export const OrderToPrintTicket = forwardRef((props, ref) => {
59
59
  return array.join('')
60
60
  }
61
61
 
62
+ const getIncludedTaxes = (isDeliveryFee) => {
63
+ if (!order?.taxes) return 0
64
+ if (order?.taxes?.length === 0) {
65
+ return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
66
+ } else {
67
+ return order?.taxes.reduce((taxIncluded, tax) => {
68
+ return taxIncluded + (((!isDeliveryFee && tax.type === 1 && tax.target === 'product') || (isDeliveryFee && tax.type === 1 && tax.target === 'delivery_fee')) ? tax.summary?.tax : 0)
69
+ }, 0)
70
+ }
71
+ }
72
+
62
73
  const getOptions = (options, productComment = '') => {
63
74
  const array = []
64
75
 
65
- options?.length &&
66
- options?.map((option) => {
76
+ options && options.length &&
77
+ options.map((option) => {
67
78
  const string =
68
79
  `${option.name} ${getSuboptions(option.suboptions)}`
69
80
  array.push(string)
@@ -175,9 +186,9 @@ export const OrderToPrintTicket = forwardRef((props, ref) => {
175
186
  </InsideInfo>
176
187
  <InsideInfo2>
177
188
  {parsePrice(
178
- order?.tax_type === 1
179
- ? order?.summary?.subtotal + order?.summary?.tax ?? 0
180
- : order?.summary?.subtotal ?? 0
189
+ order?.tax_type === 1
190
+ ? order?.summary?.subtotal + order?.summary?.tax ?? 0
191
+ : order?.summary?.subtotal ?? 0
181
192
  )}
182
193
  </InsideInfo2>
183
194
  </InfoContainer>
@@ -213,7 +224,7 @@ export const OrderToPrintTicket = forwardRef((props, ref) => {
213
224
  {t('DELIVERY_FEE', 'Delivery Fee')}
214
225
  </InsideInfo>
215
226
  <InsideInfo2>
216
- {parsePrice(order?.summary?.delivery_price)}
227
+ {parsePrice(order?.summary?.delivery_price + getIncludedTaxes(true), { currency: getCurrenySymbol(order?.currency) })}
217
228
  </InsideInfo2>
218
229
  </InfoContainer>
219
230
  )}
@@ -249,3 +260,5 @@ export const OrderToPrintTicket = forwardRef((props, ref) => {
249
260
  </PrintContainer>
250
261
  )
251
262
  })
263
+
264
+ OrderToPrintTicket.displayName = 'OrderToPrintTicket'
package/src/index.js CHANGED
@@ -135,6 +135,7 @@ import {
135
135
  DriversGroupPaymethods,
136
136
  DriversGroupLogistics,
137
137
  DriversGroupLogs,
138
+ DriversAdvancedLogs,
138
139
  DriversGroupCompanies,
139
140
  DriversGroupDrivers,
140
141
  DriversGroupOrders,
@@ -557,6 +558,7 @@ export {
557
558
  DriversGroupPaymethods,
558
559
  DriversGroupLogistics,
559
560
  DriversGroupLogs,
561
+ DriversAdvancedLogs,
560
562
  DriversGroupCompanies,
561
563
  DriversGroupDrivers,
562
564
  DriversGroupOrders,