|
|
@@ -360,7 +360,19 @@ function formatOrderAsPlainText(o: any): string {
|
|
|
|
|
|
let text = `Id: #${orderNum}`;
|
|
|
text += `\nCustomer: ${customerName}${phone ? ' ' + phone : ''}${email ? ' ' + email : ''}`;
|
|
|
- text += `\nStatus: ${o.status || 'unknown'}`;
|
|
|
+
|
|
|
+ // Handle status - ShopRenter returns status as an object with name property
|
|
|
+ let statusText = 'unknown';
|
|
|
+ if (o.status) {
|
|
|
+ if (typeof o.status === 'string') {
|
|
|
+ statusText = o.status;
|
|
|
+ } else if (o.status.name) {
|
|
|
+ statusText = o.status.name;
|
|
|
+ } else if (o.status.id) {
|
|
|
+ statusText = o.status.id.toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ text += `\nStatus: ${statusText}`;
|
|
|
|
|
|
const currency = o.currency?.code || o.currency || '';
|
|
|
text += `\nTotal: ${o.total || '0'}${currency ? ' ' + currency : ''}`;
|