# Manage Withdraw and Payout

Choose method for Payout:&#x20;

Go to **Event >> Settings >> Tax & Profit >> Manage Payout by tab**

![](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-MXv2jPSi2qtJ_GAu-66%2F-MXv3Nm9hpgLTJz11IYR%2FScreen%20Shot%202021-04-10%20at%204.16.02%20PM.jpg?alt=media\&token=0c558772-95dd-47e1-822c-92a5206f44d4)

In Manage Payout by tab, there are 2 options for you to choose:&#x20;

* Closed Event Option
* Any Time Option

{% tabs %}
{% tab title="If choosing "Closed Event" Option" %}
Go to: **Events >> Manage Payouts**

X days after events are closed, the list of events the admin must pay to vendors will appear in the payout section. The admin will then manually send the profit to the vendors. After successfully paying the profit for a booking, the admin will update the status from Pending to Paid.&#x20;

Payout Status: Pending

![](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-M2OkHomnD-GwTrg-wZN%2F-M2OnqIYe8z0smDwbXuA%2FScreen%20Shot%202020-03-14%20at%2011.09.53%20PM.jpg?alt=media\&token=91143ace-7d9b-4ad7-bc4c-bef0e1d0bf57)

Payout Status: Paid

![](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-M2OkHomnD-GwTrg-wZN%2F-M2Oo0-KVbwexoZj2m10%2FScreen%20Shot%202020-03-14%20at%2011.10.41%20PM.jpg?alt=media\&token=86a2066d-1815-4e36-8706-fb3aaa07b496)
{% endtab %}

{% tab title="If Choosing "Any Time" Option (recommend)" %}
## 1: Manage Payout

### 1.1: Admin Sets Payout Method&#x20;

Go to **Events >> Manage Payout >> Payout Method >> Add New Payout Method**

![Admin add payout method](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-McwDBGU-38FQTrKQ9XZ%2F-McwEN3s1udAGjGya_r5%2FScreen%20Shot%202021-06-24%20at%2011.17.57%20AM.jpg?alt=media\&token=209d5d99-76b7-4c76-bca8-45a35691edc1)

### 1.2: The vendor will select a Payout Method

![Vendor choose Payout Method](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-McwDBGU-38FQTrKQ9XZ%2F-McwEkdbLAw7xtkYsM15%2FScreen%20Shot%202021-06-24%20at%2011.19.44%20AM.jpg?alt=media\&token=13c717b8-3811-4830-afe4-b9b044a73489)

### **1.3: The Vendor will** withdraw amount from his account

![Manage Wallet](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-MXv5xcqzyXfTdfhuDeP%2F-MXv8JOO3ttwsSpBG5Fh%2FScreen%20Shot%202021-04-10%20at%204.37.37%20PM.jpg?alt=media\&token=cd154148-4233-4f3a-abcd-0640218b7a42)

![Insert Amount to withdraw](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-McwEzCIOyk5qw0_9l2p%2F-McwHljH5WnbVyqO08Ig%2FScreen%20Shot%202021-06-24%20at%2011.32.37%20AM.jpg?alt=media\&token=87815faf-3179-46df-864f-536680671145)

### **1.4:** The admin will see the vendor’s withdrawal request in the Payout Section

![](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-McwEzCIOyk5qw0_9l2p%2F-McwIV8aq431gczUvMcW%2FScreen%20Shot%202021-06-24%20at%2011.36.07%20AM.jpg?alt=media\&token=f7c4ffd9-cb89-4498-abc1-c876b0aa4dff)

### **1.5:** The admin can update the payout status to: Completed, Canceled, or Pending

![](https://4016371164-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1-bzGggknMKVWOqg5-%2F-McwEzCIOyk5qw0_9l2p%2F-McwIipKJxqW9itJj2Pb%2FScreen%20Shot%202021-06-24%20at%2011.37.04%20AM.jpg?alt=media\&token=3bd13260-e9e5-41c4-b9db-3d3c2467b067)

## **2: Update Calculate Profit for Vendor**

You can use filter hook: '**el\_get\_profit\_id\_booking**' to calculate profit for Vendor.

```
// Some code
add_filter( 'el_get_profit_id_booking', 'get_profit_by_id_booking_customize', 10, 2 );

function get_profit_by_id_booking_customize ( $profit, $id_booking ) {

	if ($id_booking == null) return ;

	$id_event = get_post_meta( $id_booking, OVA_METABOX_EVENT . 'id_event', true );
	$total_after_tax = get_post_meta(  $id_booking, OVA_METABOX_EVENT . 'total_after_tax', true );
	$total_before_tax = get_post_meta( $id_booking, OVA_METABOX_EVENT .'total', true );


	$list_ticket_by_id_booking = EL_Ticket::instance()->get_list_ticket_by_id_booking($id_booking);
	$number_ticket = count($list_ticket_by_id_booking);

	$number_ticket_free = EL_Ticket::instance()->get_number_ticket_free_by_id_booking($id_booking);
	$number_ticket_paid = $number_ticket - $number_ticket_free; 

    $total_admin =  get_total_admin($id_event, $total_before_tax, $number_ticket_paid, $number_ticket_free);

	$profit = $total_before_tax - $total_admin;
	
    return $profit;
	
}
```
{% endtab %}
{% endtabs %}

