mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
bulk actions for purchase orders
This commit is contained in:
parent
7d5bf2c794
commit
b705cf0520
@ -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…
x
Reference in New Issue
Block a user