Commit c3b68f3b authored by wxl's avatar wxl

添加采购入库时间

parent a01e110b
......@@ -92,6 +92,12 @@ class WarehouseOrder extends BaseEntity
* @ORM\Column(name="admin_id", type="integer", length=11)
*/
private $adminId;
/**
* 采购时间
* @ORM\Column(name="create_time", type="integer", length=10)
*/
private $createTime;
/**
* @var
......@@ -314,5 +320,19 @@ class WarehouseOrder extends BaseEntity
{
$this->adminId = $adminId;
}
/**
* @return mixed
*/
public function getCreateTime()
{
return $this->createTime;
}
/**
* @param mixed $createTime
*/
public function setCreateTime($createTime)
{
$this->createTime = $createTime;
}
}
\ No newline at end of file
......@@ -112,6 +112,25 @@ class SearchWarehouseOrderForm extends Form
'class' => 'form-control input-sm'
]
]);
$this->add([
'type' => 'text',
'name' => 'start_time',
'attributes' => [
'id' => 'start_time',
'class' => 'form-control input-sm',
'placeholder' => $this->translator->translate('起始时间')
]
]);
$this->add([
'type' => 'text',
'name' => 'end_time',
'attributes' => [
'id' => 'end_time',
'class' => 'form-control input-sm',
'placeholder' => $this->translator->translate('结束时间')
]
]);
}
public function addInputFilter()
......@@ -187,5 +206,22 @@ class SearchWarehouseOrderForm extends Form
['name' => 'ToInt']
]
]);
$inputFilter->add([
'name' => 'start_time',
'required' => false,
'filters' => [
['name' => 'StringTrim'],
['name' => 'StripTags']
]
]);
$inputFilter->add([
'name' => 'end_time',
'required' => false,
'filters' => [
['name' => 'StringTrim'],
['name' => 'StripTags']
]
]);
}
}
\ No newline at end of file
......@@ -48,6 +48,8 @@ class WarehouseOrderRepository extends EntityRepository
if(isset($search['supplier_id']) && $search['supplier_id'] > 0) $queryBuilder->andWhere($queryBuilder->expr()->eq('o.supplierId', $search['supplier_id']));
if(isset($search['payment_code']) && !empty($search['payment_code'])) $queryBuilder->andWhere($queryBuilder->expr()->eq('o.paymentCode', ':code'))->setParameter('code', $search['payment_code']);
if(isset($search['p_order_state']) && !empty($search['p_order_state'])) $queryBuilder->andWhere($queryBuilder->expr()->eq('o.pOrderState', $search['p_order_state']));
if(isset($search['start_time']) && !empty($search['start_time'])) $queryBuilder->andWhere($queryBuilder->expr()->gte('w.createTime', ':startTime'))->setParameter('startTime', strtotime($search['start_time']));
if(isset($search['end_time']) && !empty($search['end_time'])) $queryBuilder->andWhere($queryBuilder->expr()->lte('w.createTime', ':endTime'))->setParameter('endTime', strtotime($search['end_time']));
return $queryBuilder;
}
......
......@@ -57,6 +57,7 @@ class WarehouseOrderManager
$warehouseOrder->setAdminId($adminId);
$warehouseOrder->setOneOrder($order);
$warehouseOrder->setOneWarehouse($warehouseInfo);
$warehouseOrder->setCreateTime(time());
$this->entityManager->persist($warehouseOrder);
$this->entityManager->flush();
......
......@@ -27,6 +27,7 @@
<th width="10%"><?php echo $this->translate('付款方式'); ?></th>
<th width="10%"><?php echo $this->translate('采购金额'); ?></th>
<th width="6%"><?php echo $this->translate('状态'); ?></th>
<th width="10%"><?php echo $this->translate('时间'); ?></th>
<th width="12%"><?php echo $this->translate('操作'); ?></th>
</tr>
<?php
......@@ -70,6 +71,16 @@
<?php echo $this->formElement($sForm->get('p_order_state')); ?>
<?php echo $this->formElementErrors($sForm->get('p_order_state'), ['class'=>'error-message']);?>
</td>
<td>
<p>
<?php echo $this->formElement($sForm->get('start_time')); ?>
</p>
<div>
<?php echo $this->formElement($sForm->get('end_time')); ?>
</div>
<?php echo $this->formElementErrors($sForm->get('start_time'), ['class'=>'error-message']); ?>
<?php echo $this->formElementErrors($sForm->get('end_time'), ['class'=>'error-message']); ?>
</td>
<td>
<button type="submit" class="btn btn-info btn-sm"><i class="fa fa-search"></i></button>
<?php if(!empty(array_filter($sForm->getData()))) { ?>
......@@ -89,6 +100,7 @@
<td><?php echo $this->PurchaseHelper()->orderPayment($order->getWarehouseOrderPaymentCode()); ?></td>
<td><?php echo $this->erpCurrencyFormat($order->getWarehouseOrderAmount()); ?></td>
<td><?php echo $this->PurchaseHelper()->orderState($order->getWarehouseOrderState(), 2); ?></td>
<td><?php echo date("Y-m-d H:i", $order->getCreateTime()); ?></td>
<td>
<a href="<?php echo $this->url('warehouse-order',
['action'=>'view', 'id'=>$order->getWarehouseOrderId()]); ?>"
......
......@@ -91,7 +91,12 @@
</div>
<div class="row">
<div class="col-xs-12 form-group">
<div class="col-xs-4 form-group">
<div class="col-sm-12">
<b><?php echo $this->translate('采购入库时间'); ?></b><?php echo date("Y-m-d H:i:s", $this->orderInfo->getCreateTime());?>
</div>
</div>
<div class="col-xs-8 form-group">
<div class="col-sm-12">
<b><?php echo $this->translate('备注'); ?></b><?php echo $this->escapeHtml($this->orderInfo->getPOrderInfo());?>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment