Explorar o código

Add date column to documents table

Alan Lam %!s(int64=3) %!d(string=hai) anos
pai
achega
02613986b3
Modificáronse 2 ficheiros con 14 adicións e 6 borrados
  1. 9 1
      views/documents.php
  2. 5 5
      views/sales_table.php

+ 9 - 1
views/documents.php

@@ -21,6 +21,9 @@ use App\Helpers\HtmlHelper;
  * @var int $custom_filter
  */
 
+$core = Core::getInstance();
+$user = $core->getUser();
+
 $is_sale_order = ($type === DocumentTypes::SALES_ORDER);
 $is_goods_in = ($type === DocumentTypes::GOODS_IN);
 $is_aru = ($type === DocumentTypes::ADVANCE_REPLACEMENT_UNIT);
@@ -154,6 +157,7 @@ else {
 	<table class="table table-bordered table-hover mb-3">
 		<colgroup>
 			<col style="width: 1%"/>
+			<col style="width: 10%"/>
 			<?php
 			if(!$status_options) {
 				?>
@@ -167,12 +171,13 @@ else {
 				<?php
 			}
 			?>
-			<col style="width: 60%"/>
+			<col style="width: 50%"/>
 			<col style="width: 1%"/>
 		</colgroup>
 		<thead>
 		<tr>
 			<th><?=htmlspecialchars(__("No."))?></th>
+			<th><?=htmlspecialchars(__("Date"))?></th>
 			<?php
 			if(!$status_options) {
 				if($is_goods_in) {
@@ -207,6 +212,9 @@ else {
 				<td class="text-end">
 					<a href="<?=htmlspecialchars($document->getUrl())?>"><?=$document->number?></a>
 				</td>
+				<td>
+					<?=htmlspecialchars($user->formatDate($document->getDateTimeCreated()))?>
+				</td>
 				<td>
 					<?php
 					if($location) {

+ 5 - 5
views/sales_table.php

@@ -12,8 +12,8 @@ $user = $core->getUser();
 <table class="table table-bordered table-hover mb-3">
 	<colgroup>
 		<col style="width: 1%"/>
-		<col style="width: 55%"/>
 		<col style="width: 15%"/>
+		<col style="width: 55%"/>
 		<col style="width: 15%"/>
 		<col style="width: 15%"/>
 		<col style="width: 1%"/>
@@ -21,8 +21,8 @@ $user = $core->getUser();
 	<thead>
 	<tr>
 		<th><?=htmlspecialchars(__("No."))?></th>
-		<th><?=htmlspecialchars(__("Location"))?></th>
 		<th><?=htmlspecialchars(__("Date"))?></th>
+		<th><?=htmlspecialchars(__("Location"))?></th>
 		<th><?=htmlspecialchars(__("Status"))?></th>
 		<th><?=htmlspecialchars(__("Predicted Sold Date"))?></th>
 		<th><?=htmlspecialchars(__("Actions"))?></th>
@@ -37,14 +37,14 @@ $user = $core->getUser();
 			<td class="text-end">
 				<a href="<?=htmlspecialchars($sale->getUrl())?>"><?=htmlspecialchars($sale->getNumber())?></a>
 			</td>
+			<td>
+				<?=htmlspecialchars($user->formatDate($sale->getDateTimeCreated()))?>
+			</td>
 			<td>
 				<a href="<?=htmlspecialchars($location->getUrl())?>">
 					<?=htmlspecialchars($location->getDisplayName())?>
 				</a>
 			</td>
-			<td>
-				<?=htmlspecialchars($user->formatDate($sale->getDateTimeCreated()))?>
-			</td>
 			<td>
 				<?=htmlspecialchars($sale->getDisplayStatus())?>
 			</td>