@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | $state = $data['deliverable']->get_state(); |
| 4 | 4 | $formatter = $data['l10n']->get_formatter(); |
| 5 | 5 | $per_unit = $data['l10n']->get('per unit'); |
| 6 | -if ( $data['product'] |
|
| 6 | +if ($data['product'] |
|
| 7 | 7 | && $unit_option = org_openpsa_sales_viewer::get_unit_option($data['product']->unit)) { |
| 8 | 8 | $per_unit = sprintf($data['l10n']->get('per %s'), $unit_option); |
| 9 | 9 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | </div> |
| 110 | 110 | <?php |
| 111 | 111 | $tabs = []; |
| 112 | - if ( $data['invoices_url'] |
|
| 112 | + if ($data['invoices_url'] |
|
| 113 | 113 | && $data['deliverable']->invoiced > 0) { |
| 114 | 114 | $tabs[] = [ |
| 115 | 115 | 'url' => $data['invoices_url'] . "list/deliverable/{$data['deliverable']->guid}/", |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | ]; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if ( $data['projects_url'] |
|
| 120 | + if ($data['projects_url'] |
|
| 121 | 121 | && $data['deliverable']->state >= org_openpsa_sales_salesproject_deliverable_dba::STATE_ORDERED |
| 122 | 122 | && $data['product'] |
| 123 | 123 | && $data['product']->orgOpenpsaObtype == org_openpsa_products_product_dba::TYPE_SERVICE) { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | echo " </tbody>\n"; |
| 174 | 174 | echo "</table>\n"; |
| 175 | - if ( $at_entries[0]->status == midcom_services_at_entry_dba::SCHEDULED |
|
| 175 | + if ($at_entries[0]->status == midcom_services_at_entry_dba::SCHEDULED |
|
| 176 | 176 | && midcom::get()->auth->can_user_do('midgard:create', class: org_openpsa_invoices_invoice_dba::class)) { |
| 177 | 177 | $label = $data['l10n']->get('generate now'); |
| 178 | 178 | $process_link = $data['router']->generate('deliverable_run_cycle', ['guid' => $data['deliverable']->guid]); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | if ($this->_config->get('sales_pdfbuilder_class')) { |
| 86 | - if ( $this->_salesproject->can_do('midgard:update') |
|
| 86 | + if ($this->_salesproject->can_do('midgard:update') |
|
| 87 | 87 | && $this->is_pdf_creatable()) { |
| 88 | 88 | $workflow = $this->get_workflow('datamanager'); |
| 89 | 89 | $buttons[] = $workflow->get_button($this->router->generate('create_offer', ['guid' => $this->_salesproject->guid]), [ |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | case 'ordered': |
| 205 | 205 | if ($deliverable->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) { |
| 206 | 206 | $entries = $deliverable->get_at_entries(); |
| 207 | - if ( $entries |
|
| 207 | + if ($entries |
|
| 208 | 208 | && $entries[0]->status == midcom_services_at_entry_dba::SCHEDULED |
| 209 | 209 | && midcom::get()->auth->can_user_do('midgard:create', class: org_openpsa_invoices_invoice_dba::class)) { |
| 210 | 210 | return '<button class="run_cycle"><i class="fa fa-refresh"></i>' . $this->_l10n->get('generate now') . '</button>'; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | } |
| 215 | 215 | break; |
| 216 | 216 | case 'delivered': |
| 217 | - if ( $deliverable->orgOpenpsaObtype != org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
| 217 | + if ($deliverable->orgOpenpsaObtype != org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
| 218 | 218 | && midcom::get()->auth->can_user_do('midgard:create', class: org_openpsa_invoices_invoice_dba::class)) { |
| 219 | 219 | $client_class = $this->_config->get('calculator'); |
| 220 | 220 | $client = new $client_class(); |