mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
Merge pull request #7588 from turbo124/v5-develop
bulk actions for purchase orders
This commit is contained in:
commit
4839e399b5
@ -633,11 +633,23 @@ class PurchaseOrderController extends BaseController
|
|||||||
//check query parameter for email_type and set the template else use calculateTemplate
|
//check query parameter for email_type and set the template else use calculateTemplate
|
||||||
PurchaseOrderEmail::dispatch($purchase_order, $purchase_order->company);
|
PurchaseOrderEmail::dispatch($purchase_order, $purchase_order->company);
|
||||||
|
|
||||||
|
|
||||||
if (! $bulk) {
|
if (! $bulk) {
|
||||||
return response()->json(['message' => 'email sent'], 200);
|
return response()->json(['message' => 'email sent'], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'cancel':
|
||||||
|
|
||||||
|
if($purchase_order->status_id <= PurchaseOrder::STATUS_SENT)
|
||||||
|
{
|
||||||
|
$purchase_order->status_id = PurchaseOrder::STATUS_CANCELLED;
|
||||||
|
$purchase_order->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $bulk) {
|
||||||
|
return $this->listResponse($purchase_order);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return response()->json(['message' => ctrans('texts.action_unavailable', ['action' => $action])], 400);
|
return response()->json(['message' => ctrans('texts.action_unavailable', ['action' => $action])], 400);
|
||||||
break;
|
break;
|
||||||
|
@ -51,7 +51,6 @@ class PurchaseOrderService
|
|||||||
|
|
||||||
// //TODO implement design, footer, terms
|
// //TODO implement design, footer, terms
|
||||||
|
|
||||||
|
|
||||||
// /* If client currency differs from the company default currency, then insert the client exchange rate on the model.*/
|
// /* If client currency differs from the company default currency, then insert the client exchange rate on the model.*/
|
||||||
// if (!isset($this->purchase_order->exchange_rate) && $this->purchase_order->client->currency()->id != (int)$this->purchase_order->company->settings->currency_id)
|
// if (!isset($this->purchase_order->exchange_rate) && $this->purchase_order->client->currency()->id != (int)$this->purchase_order->company->settings->currency_id)
|
||||||
// $this->purchase_order->exchange_rate = $this->purchase_order->client->currency()->exchange_rate;
|
// $this->purchase_order->exchange_rate = $this->purchase_order->client->currency()->exchange_rate;
|
||||||
@ -89,7 +88,6 @@ class PurchaseOrderService
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function touchPdf($force = false)
|
public function touchPdf($force = false)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user