@@ -12,6 +12,8 @@ defmodule AlgoraWeb.Org.JobLive do
1212
1313 require Logger
1414
15+ defp default_tab , do: "applicants"
16+
1517 defmodule WirePaymentForm do
1618 @ moduledoc false
1719 use Ecto.Schema
@@ -96,7 +98,15 @@ defmodule AlgoraWeb.Org.JobLive do
9698
9799 @ impl true
98100 def mount ( % { "org_handle" => handle , "id" => id } , _session , socket ) do
99- { :ok , push_navigate ( socket , to: ~p" /#{ handle } /jobs/#{ id } /applicants" ) }
101+ { :ok , push_navigate ( socket , to: ~p" /#{ handle } /jobs/#{ id } /#{ default_tab ( ) } " ) }
102+ end
103+
104+ @ impl true
105+ def handle_params ( % { "tab" => "activate" } , _uri , socket ) do
106+ { :noreply ,
107+ socket
108+ |> assign ( :current_tab , default_tab ( ) )
109+ |> assign ( :show_payment_drawer , true ) }
100110 end
101111
102112 @ impl true
@@ -1578,14 +1588,6 @@ defmodule AlgoraWeb.Org.JobLive do
15781588 { Money . to_string! ( price ( ) ) }
15791589 </ span >
15801590 </ div >
1581- < div class = "flex justify-between items-center " >
1582- < span class = "text-sm text-muted-foreground " > Processing Fee (4%)</ span >
1583- < span class = "font-semibold font-display " >
1584- { Money . to_string! (
1585- Money . mult! ( @ current_org . subscription_price , Decimal . new ( "0.04" ) )
1586- ) }
1587- </ span >
1588- </ div >
15891591
15901592 < div class = "flex justify-between items-center " >
15911593 < span class = "text-sm text-muted-foreground " >
@@ -1601,6 +1603,15 @@ defmodule AlgoraWeb.Org.JobLive do
16011603 </ span >
16021604 </ div >
16031605
1606+ < div class = "flex justify-between items-center " >
1607+ < span class = "text-sm text-muted-foreground " > Processing Fee (4%)</ span >
1608+ < span class = "font-semibold font-display " >
1609+ { Money . to_string! (
1610+ Money . mult! ( @ current_org . subscription_price , Decimal . new ( "0.04" ) )
1611+ ) }
1612+ </ span >
1613+ </ div >
1614+
16041615 < div class = "border-t pt-4 flex justify-between items-center " >
16051616 < span class = "font-semibold " > Total</ span >
16061617 < span class = "font-semibold font-display " >
@@ -1626,26 +1637,69 @@ defmodule AlgoraWeb.Org.JobLive do
16261637 < div data-tab = "wire " class = "hidden " >
16271638 < . card >
16281639 < . card_header >
1629- < . card_title > Wire Transfer Details</ . card_title >
1630- < . card_description > Send payment to the following account</ . card_description >
1640+ < . card_title > Billing Details</ . card_title >
1641+ < . card_description >
1642+ Enter your billing details to generate an invoice
1643+ </ . card_description >
16311644 </ . card_header >
16321645 < . card_content class = "pt-0 " >
1646+ < div class = "space-y-4 " >
1647+ < . input
1648+ type = "text "
1649+ label = "Billing Name "
1650+ field = { @ wire_form [ :billing_name ] }
1651+ value = {
1652+ @ current_org . billing_name || @ current_org . display_name ||
1653+ @ current_org . handle
1654+ }
1655+ />
1656+ < . input
1657+ type = "textarea "
1658+ label = "Billing Address "
1659+ field = { @ wire_form [ :billing_address ] }
1660+ value = { @ current_org . billing_address }
1661+ />
1662+ < div class = "grid grid-cols-1 md:grid-cols-2 gap-4 " >
1663+ < . input
1664+ type = "text "
1665+ label = "Executive Name "
1666+ field = { @ wire_form [ :executive_name ] }
1667+ value = { @ current_org . executive_name }
1668+ />
1669+ < . input
1670+ type = "text "
1671+ label = "Executive Role "
1672+ field = { @ wire_form [ :executive_role ] }
1673+ value = { @ current_org . executive_role }
1674+ />
1675+ </ div >
1676+ < . input
1677+ type = "date "
1678+ label = "Invoice Date "
1679+ field = { @ wire_form [ :payment_date ] }
1680+ value = { Date . utc_today ( ) }
1681+ />
1682+ </ div >
1683+
1684+ < h4 class = "pt-6 tracking-tight font-semibold leading-none text-2xl mb-4 " >
1685+ Wire Transfer Details
1686+ </ h4 >
16331687 < div class = "space-y-4 " >
16341688 < div class = "grid grid-cols-2 gap-2 text-sm " >
1635- < span class = "text-muted-foreground " > Bank Name </ span >
1636- < span class = "font-medium " > { @ wire_details [ "bank_name " ] } </ span >
1689+ < span class = "text-muted-foreground " > Beneficiary (Account Holder) </ span >
1690+ < span class = "font-medium " > { @ wire_details [ "beneficiary " ] } </ span >
16371691
1638- < span class = "text-muted-foreground " > Account Name </ span >
1639- < span class = "font-medium " > { @ wire_details [ "account_name " ] } </ span >
1692+ < span class = "text-muted-foreground " > ACH and Wire Routing Number </ span >
1693+ < span class = "font-medium " > { @ wire_details [ "routing_number " ] } </ span >
16401694
16411695 < span class = "text-muted-foreground " > Account Number</ span >
16421696 < span class = "font-medium " > { @ wire_details [ "account_number" ] } </ span >
16431697
1644- < span class = "text-muted-foreground " > Routing Number </ span >
1645- < span class = "font-medium " > { @ wire_details [ "routing_number " ] } </ span >
1698+ < span class = "text-muted-foreground " > Account Type </ span >
1699+ < span class = "font-medium " > { @ wire_details [ "account_type " ] } </ span >
16461700
1647- < span class = "text-muted-foreground " > SWIFT Code </ span >
1648- < span class = "font-medium " > { @ wire_details [ "swift_code " ] } </ span >
1701+ < span class = "text-muted-foreground " > Bank Address </ span >
1702+ < span class = "font-medium " > { @ wire_details [ "bank_address " ] } </ span >
16491703 </ div >
16501704
16511705 < div class = "border-t pt-4 " >
@@ -1655,18 +1709,6 @@ defmodule AlgoraWeb.Org.JobLive do
16551709 { Money . to_string! ( price ( ) ) }
16561710 </ span >
16571711
1658- < span class = "text-muted-foreground line-through block " >
1659- Stripe Processing Fee
1660- </ span >
1661- < span class = "font-medium font-display flex " >
1662- < span class = "text-muted-foreground line-through " > $0</ span >
1663- < span class = "text-success-400 ml-auto " >
1664- ({ Money . to_string! (
1665- Money . mult! ( @ current_org . subscription_price , Decimal . new ( "0.04" ) )
1666- ) } saved!)
1667- </ span >
1668- </ span >
1669-
16701712 < span class = "text-muted-foreground block " >
16711713 Early Believer Discount
16721714 </ span >
@@ -1680,6 +1722,18 @@ defmodule AlgoraWeb.Org.JobLive do
16801722 ) }
16811723 </ span >
16821724 </ span >
1725+
1726+ < span class = "text-muted-foreground line-through block " >
1727+ Stripe Processing Fee
1728+ </ span >
1729+ < span class = "font-medium font-display flex " >
1730+ < span class = "text-muted-foreground line-through " > $0</ span >
1731+ < span class = "text-success-400 ml-auto " >
1732+ ({ Money . to_string! (
1733+ Money . mult! ( @ current_org . subscription_price , Decimal . new ( "0.04" ) )
1734+ ) } saved!)
1735+ </ span >
1736+ </ span >
16831737 </ div >
16841738 </ div >
16851739
@@ -1691,49 +1745,6 @@ defmodule AlgoraWeb.Org.JobLive do
16911745 </ span >
16921746 </ div >
16931747 </ div >
1694-
1695- < div class = "pt-6 " >
1696- < h4 class = "tracking-tight font-semibold leading-none text-2xl mb-4 " >
1697- Billing Details
1698- </ h4 >
1699- < div class = "space-y-4 " >
1700- < . input
1701- type = "text "
1702- label = "Billing Name "
1703- field = { @ wire_form [ :billing_name ] }
1704- value = {
1705- @ current_org . billing_name || @ current_org . display_name ||
1706- @ current_org . handle
1707- }
1708- />
1709- < . input
1710- type = "textarea "
1711- label = "Billing Address "
1712- field = { @ wire_form [ :billing_address ] }
1713- value = { @ current_org . billing_address }
1714- />
1715- < div class = "grid grid-cols-1 md:grid-cols-2 gap-4 " >
1716- < . input
1717- type = "text "
1718- label = "Executive Name "
1719- field = { @ wire_form [ :executive_name ] }
1720- value = { @ current_org . executive_name }
1721- />
1722- < . input
1723- type = "text "
1724- label = "Executive Role "
1725- field = { @ wire_form [ :executive_role ] }
1726- value = { @ current_org . executive_role }
1727- />
1728- </ div >
1729- < . input
1730- type = "date "
1731- label = "Invoice Date "
1732- field = { @ wire_form [ :payment_date ] }
1733- value = { Date . utc_today ( ) }
1734- />
1735- </ div >
1736- </ div >
17371748 </ div >
17381749 < p class = "text-sm text-muted-foreground pt-4 " >
17391750 You will receive an invoice via email once you confirm.
0 commit comments