diff --git a/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-flow.php b/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-flow.php
index 4fcdc90..98f1dec 100644
--- a/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-flow.php
+++ b/backend/app/plugins/wiaas/includes/admin/delivery-process/class-wiaas-admin-delivery-process-flow.php
@@ -16,12 +16,40 @@ class Wiaas_Admin_Order_Process_Flow {
add_filter('gravityflow_admin_action_feedback', array(__CLASS__, 'maybe_process_admin_step_change_action'), 10, 4);
- add_filter('gravityflow_admin_actions_workflow_detail', array(__CLASS__, 'remove_workflow_admin_actions'));
+ add_filter('gravityflow_admin_actions_workflow_detail', array(__CLASS__, 'filter_workflow_admin_actions'), 10, 5);
}
- public static function remove_workflow_admin_actions() {
+ /**
+ * Filter workflow admin actions
+ *
+ * @param $admin_actions
+ * @param $current_step
+ * @param $steps
+ * @param $form
+ * @param $entry
+ *
+ * @return array
+ */
+ public static function filter_workflow_admin_actions($admin_actions, $current_step, $steps, $form, $entry) {
- return array();
+ $allowed_actions = array();
+
+ // allow basic admin actions for step action workflow
+ if (Wiaas_Delivery_Process_Action::is_action_form($form)) {
+
+ $allowed_actions = array( 'cancel_workflow', 'restart_workflow', 'restart_step');
+ }
+
+ $filtered_admin_actions = array();
+
+ foreach ( $admin_actions as $admin_action ) {
+
+ if (in_array($admin_action['value'], $allowed_actions)) {
+ $filtered_admin_actions[] = $admin_action;
+ }
+ }
+
+ return $filtered_admin_actions;
}
public static function render_procurement_order_download_link($form, $entry, $current_step) {
@@ -269,74 +297,61 @@ class Wiaas_Admin_Order_Process_Flow {
target_form_id );
+ $action_form = GFAPI::get_form( $step->target_form_id );
- if (empty($action_form)) {
+ if (empty($action_form)) {
- echo '';
+ echo '';
- continue;
- }
-
- $action_delivery_settings = rgar($action_form, 'wiaas_delivery_process');
-
- ?>
-
-
-
-
-
- ' .
- ' ' . $action_form['title'] . '',
- $form_url );
-
- echo $form_link;
- }
-
- echo '
';
-
- $page_size = 20;
- $search_criteria = array(
- 'status' => 'active',
- 'field_filters' => array(
- array( 'key' => 'wiaas_delivery_process_id',
- 'value' => $entry['id']
- ),
- ),
- );
- $sorting = array( 'key' => 'date_created', 'direction' => 'DESC' );
- $paging = array( 'offset' => 0, 'page_size' => $page_size );
-
- $entries = GFAPI::get_entries( $action_form['id'], $search_criteria, $sorting, $paging );
-
- foreach ($entries as $action_entry) {
- self::_display_step_action_entry($action_form, $action_entry);
- }
-
- ?>
-
-
-
-
-
-
-
- 'active',
+ 'field_filters' => array(
+ array( 'key' => 'wiaas_delivery_process_id',
+ 'value' => $entry['id']
+ ),
+ ),
+ );
+ $sorting = array( 'key' => 'date_created', 'direction' => 'DESC' );
+ $paging = array( 'offset' => 0, 'page_size' => $page_size );
+
+ $entries = GFAPI::get_entries( $action_form['id'], $search_criteria, $sorting, $paging );
+
+ if (empty($entries)) {
+
+ echo '';
+
+ continue;
+ }
+
+ ?>
+
+
+
+
+
+
';
+
+
+ foreach ($entries as $action_entry) {
+ self::_display_step_action_entry($action_form, $action_entry);
+ }
+
+ ?>
+
+
+
+
+
+
+
+
@@ -349,6 +364,13 @@ class Wiaas_Admin_Order_Process_Flow {
$current_action_step = $workflow_api->get_current_step($action_entry);
+ $entry_url = add_query_arg( array(
+ 'page' => 'gravityflow-inbox',
+ 'view' => 'entry',
+ 'id' => $action_entry['form_id'],
+ 'lid' => $action_entry['id']
+ ), admin_url() );
+
?>
@@ -384,15 +406,15 @@ class Wiaas_Admin_Order_Process_Flow {
get_status_label($current_action_step->get_status()) . ': ' . $current_action_step->get_name();
- echo '' .
- ' ' .
- '';
- } else {
- echo $workflow_api->get_status($action_entry);
- }
+ echo empty($current_action_step) ?
+ $workflow_api->get_status($action_entry) :
+ $current_action_step->get_status_label($current_action_step->get_status()) . ': ' . $current_action_step->get_name();;
+
+ echo '' .
+ ' ' .
+ '';
+
?>
diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php b/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php
index 54ae060..73c78cd 100644
--- a/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php
+++ b/backend/app/plugins/wiaas/includes/class-wiaas-db-update.php
@@ -25,7 +25,8 @@ class Wiaas_DB_Update {
'20191102112451' => 'wiaas_disable_processing_order_email_delivery',
'20191131172850' => 'wiaas_db_update_update_delivery_forms',
'20191131182856' => 'wiaas_db_update_enable_workflow_inbox_for_roles',
- '20191201133550' => 'wiaas_db_update_add_bundle_properties_ui_field'
+ '20191201133550' => 'wiaas_db_update_add_bundle_properties_ui_field',
+ '20191202133553' => 'wiaas_db_update_add_installation_date_delivery_action_form'
);
public static function execute() {
diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php b/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php
index 8815b95..3e02d21 100644
--- a/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php
+++ b/backend/app/plugins/wiaas/includes/class-wiaas-delivery-process.php
@@ -40,6 +40,7 @@ class Wiaas_Delivery_Process {
require_once( 'delivery-process/class-wiaas-field-order-installation-select.php' );
require_once( 'delivery-process/class-wiaas-field-order-bundle-document.php' );
require_once( 'delivery-process/class-wiaas-field-order-document.php' );
+ require_once( 'delivery-process/class-wiaas-field-order-bundle-installation-date.php' );
Gravity_Flow_Steps::register( new Wiaas_Delivery_Process_Step() );
diff --git a/backend/app/plugins/wiaas/includes/class-wiaas-order.php b/backend/app/plugins/wiaas/includes/class-wiaas-order.php
index 6be87a5..f288772 100644
--- a/backend/app/plugins/wiaas/includes/class-wiaas-order.php
+++ b/backend/app/plugins/wiaas/includes/class-wiaas-order.php
@@ -571,6 +571,12 @@ class Wiaas_Order {
}
}
+ // installation date
+ if (! empty($item['wiaas_installation_date'])) {
+
+ $product_line['installation_date'] = $item['wiaas_installation_date'];
+ }
+
$line_items[] = $product_line;
}
}
diff --git a/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-action-enter-installation-date.json b/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-action-enter-installation-date.json
new file mode 100644
index 0000000..2282acb
--- /dev/null
+++ b/backend/app/plugins/wiaas/includes/db-updates/data/delivery-forms/delivery-action-enter-installation-date.json
@@ -0,0 +1 @@
+{"0":{"title":"ACTION: Enter installation date","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"wiaas_order","id":1,"label":"Order Number","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":46,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","enableCalculation":false,"numberFormat":"decimal_dot","rangeMin":"","rangeMax":"","productField":"","displayOnly":"","enablePrice":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false},{"type":"wiaas_order_bundle","id":3,"label":"Bundle","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":46,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","productField":"","enablePasswordInput":"","maxLength":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_installation_select","id":4,"label":"Installation","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":46,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":[{"value":"0","text":"Select installation ..."}],"conditionalLogic":"","failed_validation":"","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"displayOnly":"","enablePrice":""},{"type":"wiaas_order_bundle_installation_date","inputType":"date","dateType":"datepicker","id":5,"label":"Installation Date","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"formId":46,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","calendarIconType":"calendar","calendarIconUrl":"","dateFormat":"mdy","productField":"","multipleFiles":false,"maxFiles":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false}],"version":"2.3.2","id":46,"useCurrentUserAsAuthor":true,"postContentTemplateEnabled":false,"postTitleTemplateEnabled":false,"postTitleTemplate":"","postContentTemplate":"","lastPageButton":null,"pagination":null,"firstPageCssClass":null,"wiaas_delivery_process":{"delivery_form_type":"action","delivery_action_code":"","automatic_action_entries_enabled":"1","automatic_action_entries_type":"bundle"},"notifications":[{"id":"5bdec7a41a761","to":"{admin_email}","name":"Admin Notification","event":"form_submission","toType":"email","subject":"New submission from {form_title}","message":"{all_fields}"}],"confirmations":[{"id":"5bdec7a41abbb","name":"Default Confirmation","isDefault":true,"type":"message","message":"Thanks for contacting us! We will get in touch with you shortly.","url":"","pageId":"","queryString":""}],"feeds":{"gravityflow":[{"id":"159","form_id":"46","is_active":"1","feed_order":"0","meta":{"step_name":"Select Installation","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"1","feed_condition_conditional_logic_object":{"conditionalLogic":{"actionType":"show","logicType":"all","rules":[{"fieldId":"4","operator":"is","value":"0"}]}},"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"editable_fields":["4"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"1","highlight_editable_fields_class":"green-background","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"selected_fields","display_fields_selected":["1","3","4"],"default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"1","assignee_notification_from_name":"WIAAS Market","assignee_notification_from_email":"support@co-ideation.com","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"{Order Number:1} - {Bundle:3} : Select installation","assignee_notification_message":"ORDER\u00a0{Order Number:1}<\/blockquote>\r\n{Bundle:3} has more than one available installation companies.\r\n\r\nGo to\u00a0{workflow_entry_url} to select which installation company will handle the installation.\r\n\r\n \r\n\r\n \r\n\r\n ","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null},{"id":"156","form_id":"46","is_active":"1","feed_order":"0","meta":{"step_name":"Enter installation date","description":"","step_type":"user_input","step_highlight":"0","step_highlight_type":"color","step_highlight_color":"#dd3333","feed_condition_conditional_logic":"0","feed_condition_conditional_logic_object":[],"scheduled":"0","schedule_type":"delay","schedule_date":"","schedule_delay_offset":"","schedule_delay_unit":"hours","schedule_date_field_offset":"0","schedule_date_field_offset_unit":"hours","schedule_date_field_before_after":"after","type":"select","assignees":["role|administrator"],"editable_fields":["5"],"routing":"","assignee_policy":"all","highlight_editable_fields_enabled":"1","highlight_editable_fields_class":"green-triangle","instructionsEnable":"0","instructionsValue":"","display_fields_mode":"all_fields","default_status":"hidden","note_mode":"not_required","assignee_notification_enabled":"0","assignee_notification_from_name":"","assignee_notification_from_email":"{admin_email}","assignee_notification_reply_to":"","assignee_notification_bcc":"","assignee_notification_subject":"","assignee_notification_message":"A new entry requires your input.","assignee_notification_disable_autoformat":"0","resend_assignee_emailEnable":"0","resend_assignee_emailValue":"7","resend_assignee_email_repeatEnable":"0","resend_assignee_email_repeatValue":"3","in_progress_notification_enabled":"0","in_progress_notification_type":"select","in_progress_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"in_progress_notification_from_name":"","in_progress_notification_from_email":"{admin_email}","in_progress_notification_reply_to":"","in_progress_notification_bcc":"","in_progress_notification_subject":"","in_progress_notification_message":"Entry {entry_id} has been updated and remains in progress.","in_progress_notification_disable_autoformat":"0","complete_notification_enabled":"0","complete_notification_type":"select","complete_notification_routing":[{"assignee":"role|administrator","fieldId":"0","operator":"is","value":"","type":""}],"complete_notification_from_name":"","complete_notification_from_email":"{admin_email}","complete_notification_reply_to":"","complete_notification_bcc":"","complete_notification_subject":"","complete_notification_message":"Entry {entry_id} has been updated completing the step.","complete_notification_disable_autoformat":"0","confirmation_messageEnable":"0","confirmation_messageValue":"Thank you.","expiration":"0","expiration_type":"delay","expiration_date":"","expiration_delay_offset":"","expiration_delay_unit":"hours","expiration_date_field_offset":"0","expiration_date_field_offset_unit":"hours","expiration_date_field_before_after":"after","status_expiration":"complete","destination_expired":"next","destination_complete":"next"},"addon_slug":"gravityflow","event_type":null}]}},"version":"2.3.2"}
\ No newline at end of file
diff --git a/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php b/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php
index 76b4f60..0a5bd98 100644
--- a/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php
+++ b/backend/app/plugins/wiaas/includes/db-updates/wiaas-db-update-general.php
@@ -121,4 +121,15 @@ function wiaas_db_update_update_delivery_forms() {
$created_forms[] = GFAPI::get_form($sample_form_id);
do_action('gform_forms_post_import', $created_forms);
+}
+
+function wiaas_db_update_add_installation_date_delivery_action_form() {
+
+ $action_form_json = file_get_contents( dirname( __FILE__ ) . '/data/delivery-forms/delivery-action-enter-installation-date.json' );
+
+ $action_form_meta = json_decode( $action_form_json, true )[0];
+
+ $action_form_id = GFAPI::add_form($action_form_meta);
+
+ do_action('gform_forms_post_import', array( GFAPI::get_form($action_form_id) ));
}
\ No newline at end of file
diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php
index 55f2f07..ecf4024 100644
--- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php
+++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-delivery-process-addon.php
@@ -24,6 +24,18 @@ class Wiaas_Delivery_Process_Addon extends Gravity_Flow_Extension {
return self::$_instance;
}
+ public function init() {
+
+ parent::init();
+
+ add_filter( 'gform_enqueue_scripts', array( $this, 'filter_gform_enqueue_scripts' ) );
+ }
+
+ public function filter_gform_enqueue_scripts( ) {
+
+ wp_enqueue_script( 'gform_datepicker_init' );
+ }
+
/**
* Extends Gravity Form entry metadata with 'wiaas_delivery_process_id'
*
diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-installation-date.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-installation-date.php
new file mode 100644
index 0000000..8a643c5
--- /dev/null
+++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-field-order-bundle-installation-date.php
@@ -0,0 +1,38 @@
+ 'wiaas_order_fields',
+ 'text' => $this->get_form_editor_field_title(),
+ );
+ }
+}
+
+
+GF_Fields::register( new Wiaas_Field_Order_Bundle_Installation_Date() );
\ No newline at end of file
diff --git a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php
index e59a77e..6195a2e 100644
--- a/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php
+++ b/backend/app/plugins/wiaas/includes/delivery-process/class-wiaas-order-fields.php
@@ -76,6 +76,33 @@ class Wiaas_Order_Fields {
// save changes to order
switch ($field->type) {
+ case 'wiaas_order_bundle_installation_date':
+ /**
+ * Persist bundle installation date
+ */
+
+ // get corresponding bundle field
+ $bundle_field = GFCommon::get_fields_by_type( $form, 'wiaas_order_bundle' )[0];
+
+ if (empty($bundle_field)) {
+
+ continue;
+ }
+
+ $bundle_item = $bundle_field->get_bundle_item( $entry[$bundle_field->id] );
+
+ if (empty($bundle_item)) {
+
+ continue;
+ }
+
+ error_log($new_value);
+
+ $bundle_item->update_meta_data('wiaas_installation_date', $new_value);
+ $bundle_item->save_meta_data();
+
+ break;
+
case 'wiaas_order_bundle_document':
/**
* Persist delivery flow documents for bundle
@@ -171,7 +198,7 @@ class Wiaas_Order_Fields {
$selected_installation = $field->get_selected_installation($new_value);
- if (empty($selected_installation)) {
+ if ( empty($selected_installation) ) {
// no installation selected
continue;
}
@@ -394,6 +421,14 @@ class Wiaas_Order_Fields {
return false;
}
+ // installation is already selected
+ if (!empty($bundle_item->get_meta('wiaas_installation', true))) {
+
+ $entry[(string) $field->id] = 'wiaas_installation_' . $order->get_id() . '|' . $bundle_item->get_meta('wiaas_installation', true);
+
+ continue;
+ }
+
$bundled_items = wc_pb_get_bundled_order_items($bundle_item, $order);
$installation_items = array();
@@ -408,7 +443,7 @@ class Wiaas_Order_Fields {
}
}
- if (empty($installation_items) && $field->isRequired) {
+ if (empty($installation_items)) {
// there is no data for required field so entry cannot be created
return false;
}
diff --git a/frontend/src/containers/orders/components/OrderInfo.jsx b/frontend/src/containers/orders/components/OrderInfo.jsx
index 5ba0603..5865735 100644
--- a/frontend/src/containers/orders/components/OrderInfo.jsx
+++ b/frontend/src/containers/orders/components/OrderInfo.jsx
@@ -51,9 +51,11 @@ class OrderInfo extends Component {
render() {
const {totalPrice, installationData} = this.props;
const {acceptedDate, proposedDate, isPreliminaryInstallationDate, isInstallationInOrder} = this.state;
- const orderPackages = installationData.packages;
const isInstallationInPackage = installationData.isInstallationInPackage;
const orderInfo = this.props.orderInfo;
+ const orderPackages = orderInfo ? orderInfo.packages : [];
+
+ const hasInstallationDates = orderPackages ? !!orderPackages.find(orderPackage => orderPackage.installationDate !== undefined) : false;
return (
@@ -85,36 +87,35 @@ class OrderInfo extends Component {
{orderInfo.tender || '-'}
- { isInstallationInOrder &&
+ {
+ orderPackages &&
+ orderPackages.map(orderPackage => {
+
+ if (orderPackage.installationDate) {
+
+
+ }
+ })
+ }
+ { hasInstallationDates &&
- { isPreliminaryInstallationDate
- ?
{orderTexts.labels.PRELIMINARY_INSTALLATION_DATE_LABEL}:
- : {orderTexts.labels.INSTALLATION_DATE}:
- }
+ {orderTexts.labels.INSTALLATION_DATE}:
{ orderPackages &&
- orderPackages.map(orderPackage =>
-
- { isInstallationInPackage[orderPackage.idOrderPackagePair] &&
-
- { orderPackages.length > 1 &&
- {orderPackage.packageName}:
- }
-
- { acceptedDate && acceptedDate[orderPackage.idOrderPackagePair]
- ? acceptedDate[orderPackage.idOrderPackagePair]
- : proposedDate && proposedDate[orderPackage.idOrderPackagePair]
- ? proposedDate[orderPackage.idOrderPackagePair]
- : orderTexts.labels.NOT_SET
- }
+ orderPackages.map(orderPackage => {
+ if (orderPackage.installationDate) {
-
-
- }
-
- )
+ return (
+ {orderPackage.name}:
+ { orderPackage.installationDate }
+
)
+ }
+
+ return null;
+
+ })
}
diff --git a/frontend/src/helpers/OrderHelper.js b/frontend/src/helpers/OrderHelper.js
index 2ccd838..9210246 100644
--- a/frontend/src/helpers/OrderHelper.js
+++ b/frontend/src/helpers/OrderHelper.js
@@ -64,6 +64,7 @@ export const fromWCOrder = (WCOrder) => {
payPeriod: packageLine['pay_period'],
shortDesc: packageLine['short_desc'],
dateCompleted: formatDate(packageLine['date_completed']),
+ installationDate: formatDate(packageLine['installation_date']),
additionalPackages: packageLine['additional_packages'] ? packageLine['additional_packages'].map(additionalPackage => ({
idPackage: additionalPackage.id,
packageName: additionalPackage.name,