View POs for a job. Closes #59

This commit is contained in:
Karl Cordes 2025-02-20 13:13:18 +11:00
parent 8b95717de7
commit b3a93ead5a
2 changed files with 41 additions and 1 deletions

View file

@ -63,6 +63,10 @@ class Job extends AppModel {
'OrderAcknowledgement' => array( 'OrderAcknowledgement' => array(
'className' => 'OrderAcknowledgement', 'className' => 'OrderAcknowledgement',
'foreign_key' => 'job_id' 'foreign_key' => 'job_id'
),
'PackingList' => array(
'className' => 'PackingList',
'foreign_key' => 'job_id'
) )
); );

View file

@ -113,6 +113,42 @@ foreach ($job['PurchaseOrder'] as $purchaseOrder):
<?php endif;?> <?php endif;?>
<div class="related">
<h3>Packing Lists for this Job</h3>
<?php if (!empty($packingLists)): ?>
<table cellpadding="0" cellspacing="0">
<tr>
<th>Packing List</th>
<th>Issue Date</th>
<th class="actions">Actions</th>
</tr>
<?php
$i = 0;
foreach ($job['PackingList'] as $packingList):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<a href="/documents/view/<?php echo $packingList["document_id"];?>"><?php echo $packingList['title']; ?></a>
</td>
<td>
<?php echo $packingList['issue_date']; ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('controller'=>'documents', 'action' => 'view', $packingList['document_id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
<div class="related"> <div class="related">
<h3> <h3>
@ -123,4 +159,4 @@ foreach ($job['PurchaseOrder'] as $purchaseOrder):
</div> </div>
<?php debug($job);?> <?php // debug($job);?>