ordering-ui-react-native 0.22.11 → 0.22.12-release

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.
Files changed (163) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/Checkout/index.tsx +40 -39
  5. package/src/components/StripeMethodForm/index.tsx +4 -2
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/context/OfflineActions/index.tsx +236 -0
  8. package/src/types/index.tsx +2 -1
  9. package/themes/business/index.tsx +2 -0
  10. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  11. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  12. package/themes/business/src/components/BusinessController/index.tsx +8 -3
  13. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  14. package/themes/business/src/components/Chat/index.tsx +15 -3
  15. package/themes/business/src/components/DriverMap/index.tsx +49 -26
  16. package/themes/business/src/components/FloatingButton/index.tsx +3 -2
  17. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  18. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  19. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  20. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  21. package/themes/business/src/components/MapView/index.tsx +36 -17
  22. package/themes/business/src/components/NewOrderNotification/index.tsx +40 -27
  23. package/themes/business/src/components/OrderDetails/Business.tsx +47 -27
  24. package/themes/business/src/components/OrderDetails/Delivery.tsx +134 -53
  25. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +128 -41
  26. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +50 -22
  27. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  28. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +84 -56
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +3 -2
  30. package/themes/business/src/components/OrderSummary/index.tsx +21 -17
  31. package/themes/business/src/components/OrdersListManager/index.tsx +13 -1
  32. package/themes/business/src/components/OrdersOption/index.tsx +217 -156
  33. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  34. package/themes/business/src/components/PreviousMessages/index.tsx +26 -3
  35. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +39 -16
  36. package/themes/business/src/components/PreviousOrders/index.tsx +74 -66
  37. package/themes/business/src/components/PrinterEdition/MessageAlert.tsx +33 -0
  38. package/themes/business/src/components/PrinterEdition/index.tsx +431 -0
  39. package/themes/business/src/components/PrinterEdition/printerList.tsx +23 -0
  40. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  41. package/themes/business/src/components/PrinterSettings/index.tsx +162 -173
  42. package/themes/business/src/components/PrinterSettings/styles.tsx +14 -1
  43. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  44. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  45. package/themes/business/src/components/StoresList/index.tsx +2 -2
  46. package/themes/business/src/components/UserProfileForm/index.tsx +16 -17
  47. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  48. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  49. package/themes/business/src/config/currency.tsx +1010 -0
  50. package/themes/business/src/layouts/SafeAreaContainer.tsx +35 -19
  51. package/themes/business/src/types/index.tsx +13 -4
  52. package/themes/business/src/utils/index.tsx +33 -3
  53. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  55. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  56. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  57. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  58. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  59. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  60. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  61. package/themes/original/index.tsx +11 -0
  62. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  63. package/themes/original/src/components/AddressList/index.tsx +8 -7
  64. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  65. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  66. package/themes/original/src/components/BusinessBasicInformation/index.tsx +5 -8
  67. package/themes/original/src/components/BusinessController/index.tsx +3 -3
  68. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +103 -92
  70. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +8 -6
  71. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  72. package/themes/original/src/components/BusinessPreorder/index.tsx +46 -28
  73. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +73 -70
  74. package/themes/original/src/components/BusinessProductsList/index.tsx +6 -7
  75. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  76. package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
  77. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  78. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +46 -14
  82. package/themes/original/src/components/CartContent/index.tsx +2 -4
  83. package/themes/original/src/components/Checkout/index.tsx +113 -59
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  91. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  92. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  93. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  94. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +11 -12
  95. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  96. package/themes/original/src/components/Help/index.tsx +2 -0
  97. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  98. package/themes/original/src/components/Home/index.tsx +3 -11
  99. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  100. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  101. package/themes/original/src/components/MessageListing/index.tsx +2 -1
  102. package/themes/original/src/components/Messages/index.tsx +27 -19
  103. package/themes/original/src/components/MomentOption/TimeListItem.tsx +56 -0
  104. package/themes/original/src/components/MomentOption/index.tsx +80 -51
  105. package/themes/original/src/components/MomentSelector/index.tsx +5 -2
  106. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  107. package/themes/original/src/components/MultiCheckout/index.tsx +55 -27
  108. package/themes/original/src/components/MultiOrdersDetails/index.tsx +1 -0
  109. package/themes/original/src/components/MyOrders/index.tsx +2 -2
  110. package/themes/original/src/components/NavBar/index.tsx +7 -4
  111. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  112. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  113. package/themes/original/src/components/OrderDetails/OrderEta.tsx +4 -3
  114. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +13 -10
  115. package/themes/original/src/components/OrderDetails/index.tsx +44 -21
  116. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  117. package/themes/original/src/components/OrderProgress/index.tsx +5 -4
  118. package/themes/original/src/components/OrderSummary/index.tsx +29 -10
  119. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  120. package/themes/original/src/components/OrdersOption/index.tsx +3 -6
  121. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  122. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  123. package/themes/original/src/components/PaymentOptions/index.tsx +0 -2
  124. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  125. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  126. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  127. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  128. package/themes/original/src/components/ProductItemAccordion/index.tsx +50 -43
  129. package/themes/original/src/components/ProductItemAccordion/styles.tsx +0 -3
  130. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  131. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  132. package/themes/original/src/components/Promotions/index.tsx +6 -9
  133. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  134. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  135. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  136. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  137. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  138. package/themes/original/src/components/Sessions/index.tsx +3 -3
  139. package/themes/original/src/components/SignupForm/index.tsx +86 -78
  140. package/themes/original/src/components/SingleOrderCard/index.tsx +6 -4
  141. package/themes/original/src/components/SingleProductCard/index.tsx +5 -5
  142. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  143. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  144. package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
  145. package/themes/original/src/components/StripeElementsForm/index.tsx +76 -62
  146. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  147. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  148. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  149. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  150. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  151. package/themes/original/src/components/UserDetails/index.tsx +17 -16
  152. package/themes/original/src/components/UserFormDetails/index.tsx +160 -134
  153. package/themes/original/src/components/UserProfile/index.tsx +9 -1
  154. package/themes/original/src/components/UserVerification/index.tsx +14 -4
  155. package/themes/original/src/components/Wallets/index.tsx +6 -3
  156. package/themes/original/src/components/WebsocketStatus/index.tsx +1 -4
  157. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  158. package/themes/original/src/components/shared/OButton.tsx +5 -4
  159. package/themes/original/src/components/shared/OInput.tsx +4 -8
  160. package/themes/original/src/components/shared/OModal.tsx +7 -2
  161. package/themes/original/src/types/index.tsx +5 -1
  162. package/themes/original/src/utils/index.tsx +30 -1
  163. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,3 +1,4 @@
1
+ import { Platform } from 'react-native'
1
2
  import { useConfig, useUtils, useLanguage} from 'ordering-components/native'
2
3
 
3
4
  import { verifyDecimals, getProductPrice } from '../../utils';
@@ -52,31 +53,32 @@ export const usePrinterCommands = () => {
52
53
  const customerName = (order: any) => `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''}`?.replace(' ', ' ')?.trim() ?? ''
53
54
 
54
55
  const deliveryDate = (order: any) => {
55
- const dateString = order?.delivery_datetime_utc ? order?.delivery_datetime_utc : order?.delivery_datetime
56
+ const dateString = order?.delivery_datetime_utc ?? order?.delivery_datetime
56
57
  const currentDate = new Date();
57
- const receivedDate: any = new Date(dateString.replace(/-/g, '/'));
58
+ const receivedDate: any = new Date(order?.delivery_datetime);
59
+
58
60
  const formattedDate = receivedDate <= currentDate
59
- ? `${t('ASAP_ABBREVIATION', 'ASAP')}(${parseDate(receivedDate.toLocaleString(), { utc: !!order?.delivery_datetime_utc })})`
60
- : parseDate(receivedDate.toLocaleString(), { utc: !!order?.delivery_datetime_utc })
61
+ ? `${t('ASAP_ABBREVIATION', 'ASAP')}(${parseDate(dateString, { utc: !!order?.delivery_datetime_utc })})`
62
+ : parseDate(dateString, { utc: !!order?.delivery_datetime_utc })
61
63
  return formattedDate
62
64
  }
63
65
 
64
- const generateProductsText = (order: any) => {
66
+ const generateProductsText = (order: any, { endLine }: any) => {
65
67
  const list: any = []
66
68
 
67
69
  if (order?.products.length) {
68
70
  order?.products.map((product: any) => {
69
- list.push(`${product?.quantity} ${product?.name} \t ${parsePrice(product.total ?? getProductPrice(product))}`)
71
+ list.push(`${product?.quantity} ${product?.name} \t ${parsePrice(product.total ?? getProductPrice(product))}${endLine}`)
70
72
 
71
73
  if (product?.ingredients?.length) {
72
- list.push({ text: `\t ${t('INGREDIENTS', 'Ingredients')}:`, props: { fontSize: 10 } })
74
+ list.push({ text: `\t ${t('INGREDIENTS', 'Ingredients')}:${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 10 : 18 } })
73
75
  product?.ingredients?.map((ingredient: any) => {
74
- list.push({ text: `\t ${t('NO', 'No')} ${ingredient.name}` , fontSize: 10 })
76
+ list.push({ text: `\t ${t('NO', 'No')} ${ingredient.name}${endLine}` , fontSize: Platform.OS === 'ios' ? 10 : 18 })
75
77
  })
76
78
  }
77
79
 
78
80
  product.options?.map((option: any) => {
79
- list.push({ text: `\t ${option.name}`, props: { fontSize: 10 } })
81
+ list.push({ text: `\t ${option.name}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 10 : 18 } })
80
82
 
81
83
  option.suboptions?.map((suboption: any) => {
82
84
  const { quantity, name, position, price } = suboption
@@ -87,13 +89,13 @@ export const usePrinterCommands = () => {
87
89
  : `${quantity} x ${name} +${parsePrice(price)}`
88
90
  : 'No'
89
91
 
90
- list.push({ text: `\t\t ${string}`, props: { fontSize: 10 } })
92
+ list.push({ text: `\t\t ${string}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 10 : 18 } })
91
93
  })
92
94
  })
93
95
 
94
96
  if (product.comment) {
95
- list.push({ text: `\t ${t('COMMENT', 'Comment')}`, props: { fontSize: 10 } })
96
- list.push({ text: `\t\t ${product.comment}`, props: { fontSize: 10 } })
97
+ list.push({ text: `\t ${t('COMMENT', 'Comment')}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 10 : 18 } })
98
+ list.push({ text: `\t\t ${product.comment}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 10 : 18 } })
97
99
  }
98
100
 
99
101
  list.push('_separator_')
@@ -103,7 +105,7 @@ export const usePrinterCommands = () => {
103
105
  return list
104
106
  }
105
107
 
106
- const paymethodsList = (order: any) => {
108
+ const paymethodsList = (order: any, { endLine }: any) => {
107
109
  const list: any = []
108
110
 
109
111
  if (order?.payment_events?.length > 0) {
@@ -116,70 +118,96 @@ export const usePrinterCommands = () => {
116
118
  ? parsePrice(order?.cash, { currency: order?.currency })
117
119
  : `-${parsePrice(event?.amount, { currency: order?.currency })}`
118
120
 
119
- list.push(`${payment} \t ${amount}`)
121
+ list.push(`${payment} \t ${amount}${endLine}`)
120
122
  })
121
123
  }
122
124
 
123
125
  return list
124
126
  }
125
127
 
126
- const generateCommands = (order: any) => {
128
+ const replaceChars = (string: string) => {
129
+ const accents: any = {
130
+ 'á': 'a',
131
+ 'é': 'e',
132
+ 'í': 'i',
133
+ 'ó': 'o',
134
+ 'ú': 'u',
135
+ 'Á': 'A',
136
+ 'É': 'E',
137
+ 'Í': 'I',
138
+ 'Ó': 'O',
139
+ 'Ú': 'U',
140
+ 'ü': 'u',
141
+ 'Ü': 'U',
142
+ 'ñ': 'n',
143
+ 'Ñ': 'N',
144
+ "'": '',
145
+ "’": '',
146
+ "`": '',
147
+ };
148
+ return string.replace(/[áéíóúÁÉÍÓÚüÜñÑ'’`]/g, (match: any) => accents[match])
149
+ }
150
+
151
+ const generateCommands = (order: any, printMode: string = 'append') => {
127
152
  let commands: any = [];
128
153
 
129
- const textProps = { fontSize: 12 }
154
+ const isAppendMode = printMode === 'append'
155
+ const jumpLine = isAppendMode ? '\n' : ' '
156
+ const endLine = isAppendMode ? '\n' : ''
157
+
158
+ const textProps = { fontSize: Platform.OS === 'ios' ? 12 : 22 }
130
159
 
131
160
  const appends: any = [
132
- { text: `${t('ORDER_NO', 'Order No.')} ${order.id}`, props: { fontSize: 16 } },
133
- ' ',
134
- order.orderStatus,
135
- { text: `${t('ORDER_TYPE', 'Order Type')}: ${deliveryStatus[order?.delivery_type]}`, props: { fontSize: 14 } },
136
- { text: `${t(`PAYMENT_METHOD${paymethodsLength(order) > 1 ? 'S' : ''}`, `Payment method${paymethodsLength(order) > 1 ? 's' : ''}`)}: ${handlePaymethodsListString(order)}`, props: { fontSize: 14 } },
137
- `${!!order?.delivery_option ? `${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: ${t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}` : ''}`,
138
- `${t('DELIVERY_DATE', 'Delivery Date')}: ${deliveryDate(order)}`,
161
+ { text: `${t('ORDER_NO', 'Order No.')} ${order.id}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 16 : 24 } },
162
+ jumpLine,
163
+ `${order.orderStatus}${endLine}`,
164
+ { text: `${t('ORDER_TYPE', 'Order Type')}: ${deliveryStatus[order?.delivery_type]}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 14 : 22 } },
165
+ { text: `${t(`PAYMENT_METHOD${paymethodsLength(order) > 1 ? 'S' : ''}`, `Payment method${paymethodsLength(order) > 1 ? 's' : ''}`)}: ${handlePaymethodsListString(order)}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 14 : 22 } },
166
+ `${!!order?.delivery_option ? { text: `${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: ${t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 14 : 22 } } : ''}`,
167
+ { text: `${t('DELIVERY_DATE', 'Delivery Date')}: ${deliveryDate(order)}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 14 : 22 } },
139
168
  '_separator_',
140
- { text: `${t('CUSTOMER_DETAILS', 'Customer details')}`, props: { fontSize: 14 } },
141
- `${t('FULL_NAME', 'Full Name')}: ${customerName(order)}`,
142
- `${t('EMAIL', 'Email')}: ${order?.customer?.email}`,
143
- `${!!order?.customer?.cellphone ? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone}` : ''}`,
144
- `${!!order?.customer?.phone ? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.phone}` : ''}`,
145
- `${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}`,
146
- `${!!order?.customer?.internal_number ? `${t('INTERNAL_NUMBER', 'Internal Number')}: ${order?.customer?.internal_number}` : ''}`,
147
- `${!!order?.customer?.zipcode ? `${t('ZIPCODE', 'Zipcode')}: ${order?.customer?.zipcode}` : ''}`,
169
+ { text: `${t('CUSTOMER_DETAILS', 'Customer details')}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 14 : 24 } },
170
+ `${t('FULL_NAME', 'Full Name')}: ${customerName(order)}${endLine}`,
171
+ `${t('EMAIL', 'Email')}: ${order?.customer?.email}${endLine}`,
172
+ `${!!order?.customer?.cellphone ? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.cellphone}${endLine}` : ''}`,
173
+ `${!!order?.customer?.phone ? `${t('MOBILE_PHONE', 'Mobile Phone')}: ${order?.customer?.phone}${endLine}` : ''}`,
174
+ `${t('FULL_ADDRESS', 'Full Addres')}: ${order?.customer?.address}${endLine}`,
175
+ `${!!order?.customer?.internal_number ? `${t('INTERNAL_NUMBER', 'Internal Number')}: ${order?.customer?.internal_number}${endLine}` : ''}`,
176
+ `${!!order?.customer?.zipcode ? `${t('ZIPCODE', 'Zipcode')}: ${order?.customer?.zipcode}${endLine}` : ''}`,
148
177
  '_separator_',
149
- { text: `${t('BUSINESS_DETAILS', 'Business details')}`, props: { fontSize: 14 } },
150
- order?.business?.name,
151
- order?.business?.email,
152
- `${!!order?.business?.cellphone ? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.cellphone}` : ''}`,
153
- `${!!order?.business?.phone ? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.phone}` : ''}`,
154
- `${t('ADDRESS', 'Address')}: ${order?.business?.address}`,
155
- `${!!order?.business?.address_notes ? `${t('SPECIAL_ADDRESS', 'Special Address')}: ${order?.business?.address_notes}` : ''}`,
178
+ { text: `${t('BUSINESS_DETAILS', 'Business details')}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 14 : 24 } },
179
+ `${order?.business?.name}${endLine}`,
180
+ `${order?.business?.email}${endLine}`,
181
+ `${!!order?.business?.cellphone ? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.cellphone}${endLine}` : ''}`,
182
+ `${!!order?.business?.phone ? `${t('BUSINESS_PHONE', 'Business Phone')}: ${order?.business?.phone}${endLine}` : ''}`,
183
+ `${t('ADDRESS', 'Address')}: ${order?.business?.address}${endLine}`,
184
+ `${!!order?.business?.address_notes ? `${t('SPECIAL_ADDRESS', 'Special Address')}: ${order?.business?.address_notes}${endLine}` : ''}`,
156
185
  '_separator_',
157
- { text: `${t('ORDER_DETAILS', 'Order Details')}`, props: { fontSize: 14 } },
158
- `${!!order?.comment ? `${t('ORDER_COMMENT', 'Order Comment')}: ${order?.comment}` : ''}`,
159
- ...generateProductsText(order),
160
- ' ',
161
- `${t('SUBTOTAL', 'Subtotal')} \t\t ${parsePrice(order.tax_type === 1 ? (order?.summary?.subtotal + order?.summary?.tax) ?? 0 : order?.summary?.subtotal ?? 0)}`,
162
- `${order?.summary?.discount > 0 ? `${order?.offer_type === 1 ? `${t('DISCOUNT', 'Discount')} (${verifyDecimals(order?.offer_rate, parsePrice)}%)` : t('DISCOUNT', 'Discount')} \t\t ${parsePrice(order?.summary?.discount)}` : ''}`,
163
- `${order?.tax_type !== 1 ? `${t('TAX', 'Tax')} (${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%) \t\t ${parsePrice(order?.summary?.tax ?? 0)}` : ''}`,
164
- `${order?.summary?.delivery_price > 0 && order.delivery_type !== 2 ? `${t('DELIVERY_FEE', 'Delivery Fee')} \t\t ${parsePrice(order?.summary?.delivery_price ?? 0)}` : ''}`,
165
- `${(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) && order.delivery_type !== 2 ? `${t('DRIVER_TIP', 'Driver tip')} ${percentTip(order) ? `(${percentTip(order)}%)` : ''} \t\t ${parsePrice(order?.summary?.driver_tip ?? 0)}` : ''}`,
166
- `${t('SERVICE_FEE', 'Service Fee')} (${verifyDecimals(order?.summary?.service_fee, parseNumber)}%) \t\t ${parsePrice(order?.summary?.service_fee ?? 0)}`,
186
+ { text: `${t('ORDER_DETAILS', 'Order Details')}${endLine}`, props: { fontSize: Platform.OS === 'ios' ? 14 : 24 } },
187
+ `${!!order?.comment ? `${t('ORDER_COMMENT', 'Order Comment')}: ${order?.comment}${endLine}` : ''}`,
188
+ ...generateProductsText(order, { endLine }),
189
+ `${t('SUBTOTAL', 'Subtotal')} \t\t ${parsePrice(order.tax_type === 1 ? (order?.summary?.subtotal + order?.summary?.tax) ?? 0 : order?.summary?.subtotal ?? 0)}${endLine}`,
190
+ `${order?.summary?.discount > 0 ? `${order?.offer_type === 1 ? `${t('DISCOUNT', 'Discount')} (${verifyDecimals(order?.offer_rate, parsePrice)}%)${endLine}` : t('DISCOUNT', 'Discount')} \t\t ${parsePrice(order?.summary?.discount)}${endLine}` : ''}`,
191
+ `${order?.tax_type !== 1 ? `${t('TAX', 'Tax')} (${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%) \t\t ${parsePrice(order?.summary?.tax ?? 0)}${endLine}` : ''}`,
192
+ `${order?.summary?.delivery_price > 0 && order.delivery_type !== 2 ? `${t('DELIVERY_FEE', 'Delivery Fee')} \t\t ${parsePrice(order?.summary?.delivery_price ?? 0)}${endLine}` : ''}`,
193
+ `${(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) && order.delivery_type !== 2 ? `${t('DRIVER_TIP', 'Driver tip')} ${percentTip(order) ? `(${percentTip(order)}%)` : ''} \t\t ${parsePrice(order?.summary?.driver_tip ?? 0)}${endLine}` : ''}`,
194
+ `${order?.summary?.service_fee > 0 ? `${t('SERVICE_FEE', 'Service Fee')} (${verifyDecimals(order?.summary?.service_fee, parseNumber)}%) \t\t ${parsePrice(order?.summary?.service_fee ?? 0)}${endLine}` : ''}`,
167
195
  '_separator_',
168
- `${t('TOTAL', 'Total')} \t\t ${parsePrice(order?.summary?.total ?? 0)}`,
169
- ' ',
170
- `${order?.payment_events?.length > 0 ? `${t('PAYMENTS', 'Payments')}` : ''}`,
171
- ...paymethodsList(order),
172
- ' ',
173
- ' ',
196
+ `${t('TOTAL', 'Total')} \t\t ${parsePrice(order?.summary?.total ?? 0)}${endLine}`,
197
+ jumpLine,
198
+ `${order?.payment_events?.length > 0 ? `${t('PAYMENTS', 'Payments')}${endLine}` : ''}`,
199
+ ...paymethodsList(order, { endLine }),
200
+ jumpLine,
201
+ jumpLine,
174
202
  ]
175
203
 
176
204
  commands = [
177
205
  ...commands,
178
206
  ...appends.map((append: any) => {
179
207
  return append === '_separator_'
180
- ? { appendBitmapText: '---------------------------------------' }
208
+ ? { [printMode]: `-------------------------------------${endLine}` }
181
209
  : {
182
- appendBitmapText: append?.text ?? append,
210
+ [printMode]: replaceChars(append?.text ?? append),
183
211
  ...textProps,
184
212
  ...append?.props
185
213
  }
@@ -44,6 +44,7 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
44
44
  }>({ open: false, content: [], key: null });
45
45
 
46
46
  const logisticOrderStatus = [4, 6, 7]
47
+ const deliveryTypes = [1, 7]
47
48
  const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
48
49
 
49
50
  const showFloatButtonsAcceptOrReject: any = {
@@ -99,7 +100,7 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
99
100
  <View
100
101
  style={{
101
102
  height:
102
- order?.status === 8 && order?.delivery_type === 1 ? 50 : 35,
103
+ order?.status === 8 && deliveryTypes?.includes(order?.delivery_type) ? 50 : 35,
103
104
  }}
104
105
  />
105
106
 
@@ -170,7 +171,7 @@ export const OrderDetailsLogisticUI = (props: OrderDetailsLogisticParams) => {
170
171
  secondButton={true}
171
172
  firstColorCustom={theme.colors.red}
172
173
  secondColorCustom={theme.colors.green}
173
- widthButton={isHideRejectButtons ? '100%': '45%'}
174
+ widthButton={isHideRejectButtons ? '100%' : '45%'}
174
175
  isHideRejectButtons={isHideRejectButtons}
175
176
  />
176
177
  )}
@@ -99,12 +99,13 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
99
99
  }
100
100
 
101
101
  const deliveryDate = (order: any) => {
102
- const dateString = order?.delivery_datetime_utc ? order?.delivery_datetime_utc : order?.delivery_datetime
102
+ const dateString = order?.delivery_datetime_utc ?? order?.delivery_datetime
103
103
  const currentDate = new Date();
104
- const receivedDate: any = new Date(dateString.replace(/-/g, '/'));
104
+ const receivedDate: any = new Date(order?.delivery_datetime);
105
+
105
106
  const formattedDate = receivedDate <= currentDate
106
- ? `${t('ASAP_ABBREVIATION', 'ASAP')}(${parseDate(receivedDate.toLocaleString(), { utc: !!order?.delivery_datetime_utc })})`
107
- : parseDate(receivedDate.toLocaleString(), { utc: !!order?.delivery_datetime_utc })
107
+ ? `${t('ASAP_ABBREVIATION', 'ASAP')}(${parseDate(dateString, { utc: !!order?.delivery_datetime_utc })})`
108
+ : parseDate(dateString, { utc: !!order?.delivery_datetime_utc })
108
109
  return formattedDate
109
110
  }
110
111
 
@@ -158,7 +159,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
158
159
 
159
160
  ${t('DELIVERY_DATE', 'Delivery Date')}: ${deliveryDate(order)}
160
161
  </br>
161
- ${t(paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD', paymethodsLength > 1 ? 'Payment methods' : 'Payment method')}: ${handlePaymethodsListString()}
162
+ ${t(paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD', paymethodsLength > 1 ? 'Payment methods' : 'Payment method')}: ${order?.payment_events?.length > 0 ? handlePaymethodsListString() : t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}
162
163
  </p>
163
164
 
164
165
  <h1>${t('CUSTOMER_DETAILS', 'Customer details')}</h1>
@@ -318,18 +319,19 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
318
319
 
319
320
  </div>
320
321
 
321
- <div style="display: flex">
322
+ ${order?.summary?.service_fee > 0 && `
323
+ <div style="display: flex">
324
+ <div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start">
325
+ ${t('SERVICE_FEE', 'Service Fee')}
326
+ (${verifyDecimals(order?.summary?.service_fee, parseNumber)}%)
327
+ </div>
322
328
 
323
- <div style="font-size: 26px; width: 70%; display: flex; justify-content: flex-start">
324
- ${t('SERVICE_FEE', 'Service Fee')}
325
- (${verifyDecimals(order?.summary?.service_fee, parseNumber)}%)
326
- </div>
329
+ <div style="font-size: 26px; width: 30%; display: flex; justify-content: flex-end">
330
+ ${parsePrice(order?.summary?.service_fee ?? 0)}
331
+ </div>
327
332
 
328
- <div style="font-size: 26px; width: 30%; display: flex; justify-content: flex-end">
329
- ${parsePrice(order?.summary?.service_fee ?? 0)}
330
333
  </div>
331
-
332
- </div>
334
+ `}
333
335
 
334
336
  <div style="display: flex">
335
337
 
@@ -486,7 +488,9 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
486
488
  {`${t('DELIVERY_DATE', 'Delivery Date')}: ${deliveryDate(order)}`}
487
489
  </OText>
488
490
 
489
- <OText style={{ marginBottom: 5 }}>{`${t(`${paymethodsLength > 1 ? 'PAYMENT_METHODS' : 'PAYMENT_METHOD'}`, `${paymethodsLength > 1 ? 'Payment methods' : 'Payment method'}`)}: ${handlePaymethodsListString()}`}</OText>
491
+ <OText style={{ marginBottom: 5 }}>
492
+ {`${t(`${paymethodsLength > 1? 'PAYMENT_METHODS' : 'PAYMENT_METHOD'}`, `${paymethodsLength > 1 ? 'Payment methods' : 'Payment method'}`)}: ${order?.payment_events?.length > 0 ? handlePaymethodsListString() : t(order?.paymethod?.gateway?.toUpperCase(), order?.paymethod?.name)}`}
493
+ </OText>
490
494
 
491
495
  </OrderHeader>
492
496
 
@@ -562,7 +566,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
562
566
  </OText>
563
567
  )}
564
568
 
565
- {order?.customer?.address_notes && (
569
+ {!!order?.customer?.address_notes && (
566
570
  <OText style={{ marginBottom: 5 }}>
567
571
  {`${t('NOTES', 'Notes')}: ${order?.customer?.address_notes}`}
568
572
  </OText>
@@ -661,7 +665,7 @@ export const OrderSummary = ({ order, navigation, orderStatus, askBluetoothPermi
661
665
  {t('ORDER_DETAILS', 'Order Details')}
662
666
  </OText>
663
667
 
664
- {order?.comment && (
668
+ {!!order?.comment && (
665
669
  <OText style={{ marginBottom: 5 }}>
666
670
  {`${t('ORDER_COMMENT', 'Order Comment')}: ${order?.comment}`}
667
671
  </OText>
@@ -846,6 +846,18 @@ export const OrdersListManager = (props: OrdersOptionParams) => {
846
846
  {
847
847
  key: 23,
848
848
  text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
849
+ },
850
+ {
851
+ key: 24,
852
+ text: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order')
853
+ },
854
+ {
855
+ key: 25,
856
+ text: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company')
857
+ },
858
+ {
859
+ key: 26,
860
+ text: t('ORDER_DRIVER_ARRIVED_CUSTOMER', 'Driver arrived to customer')
849
861
  }
850
862
  ],
851
863
  tabs: [
@@ -858,7 +870,7 @@ export const OrdersListManager = (props: OrdersOptionParams) => {
858
870
  {
859
871
  key: 1,
860
872
  text: t('IN_PROGRESS', 'In Progress'),
861
- tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
873
+ tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23, 24, 25, 26],
862
874
  title: 'inProgress',
863
875
  },
864
876
  {