<?xml version="1.0" encoding="UTF-8"?>

<customErpPackage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<packageDescription>
    <name>BILLCOM_SYNC_LOGDELETES_ADDLINK</name>
    <description>Create Smart Events to log department, location, vendor, GL account, class, customer, item and project deletes in Intacct. This package is required to allow Bill.com Sync also delete these records in Bill.com. In addition, it will add custom fields and a link in the transaction details page to view the bill, vendor credit or invoice image in Bill.com.</description>
    <author>Bill.com</author>
</packageDescription>

<customFields>

    <customField>
        <customFieldId>BDC_BILLID</customFieldId>
        <type>text</type>
        <ownerObject>apbill</ownerObject>
        <label>BDC_BILLID</label>
        <dataDescription><text><length>20</length></text></dataDescription>
        <required>false</required>
        <hidden>true</hidden>
    </customField>

    <customField>
        <customFieldId>BDC_ORGID</customFieldId>
        <type>text</type>
        <ownerObject>apbill</ownerObject>
        <label>BDC_ORGID</label>
        <dataDescription><text><length>20</length></text></dataDescription>
        <required>false</required>
        <hidden>true</hidden>
    </customField>

    <customField>
        <customFieldId>BDC_URL_PREFIX</customFieldId>
        <type>text</type>
        <ownerObject>apbill</ownerObject>
        <label>BDC_URL_PREFIX</label>
        <dataDescription><text><length>500</length></text></dataDescription>
        <required>false</required>
        <hidden>true</hidden>
    </customField>
    
    <customField><customFieldId>BDC_INVOICEID</customFieldId>
        <type>text</type>
        <ownerObject>arinvoice</ownerObject>
        <label>BDC_INVOICEID</label>
        <dataDescription><text><length>20</length></text></dataDescription>
        <required>false</required>
        <hidden>true</hidden>
    </customField>
    
    <customField>
        <customFieldId>BDC_ORGID</customFieldId>
        <type>text</type>
        <ownerObject>arinvoice</ownerObject>
        <label>BDC_ORGID</label>
        <dataDescription><text><length>20</length></text></dataDescription>
        <required>false</required>
        <hidden>true</hidden>
    </customField>
    
    <customField>
        <customFieldId>BDC_URL_PREFIX</customFieldId>
        <type>text</type>
        <ownerObject>arinvoice</ownerObject>
        <label>BDC_URL_PREFIX</label>
        <dataDescription><text><length>500</length></text></dataDescription>
        <required>false</required>
        <hidden>true</hidden>
    </customField>


</customFields>

<smartLinks>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_DEPARTMENTS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>department</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any department deleted in Intacct. This smart link is used by Bill.com Sync to delete in Bill.com departments deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_ACCOUNTS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>glaccount</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any GL account deleted in Intacct. This smart link is used by Bill.com Sync to delete in Bill.com accounts deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_LOCATIONS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>location</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any location deleted in Intacct. This smart link is used by Bill.com Sync to delete in Bill.com locations deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_VENDORS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>vendor</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any vendor deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com vendors deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_CLASSES_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>class</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any class deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com classes deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_CUSTOMERS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>customer</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any customer deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com customers deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_ITEMS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>item</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any item deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com items deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_PROJECTS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>project</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any project deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com projects deleted in Intacct.</description>
    </smartLink>
    
    
    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_EMPLOYEES_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>employee</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any employee deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com employee deleted in Intacct.</description>
    </smartLink>
    
    
    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_BILLS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>apbill</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any ap bills deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com ap bills deleted in Intacct.</description>
    </smartLink>
    
    
    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_INVOICES_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>arinvoice</ownerObject>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any AR invoice deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com ar invoices deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BILLCOM_SYNC_LOG_PURCHASEORDERS_DEL</smartLinkId>
        <type>workflow</type>
        <ownerObject>podocument</ownerObject>
		<documentTypes>
			<documentType>ALL</documentType>
		</documentTypes>
        <events>
            <event>delete</event>
        </events>
        <renderDetails>
            <workflow>
                <action>
                    <logAction></logAction>
                </action>
            </workflow>
        </renderDetails>
        <description>Log any PO deleted in Intacct. This smart link is used by Bill.com Sync to delete (deactivate) in Bill.com po deleted in Intacct.</description>
    </smartLink>

    <smartLink>
        <smartLinkId>BDC_VIEW_TRANSACTION_DETAILS</smartLinkId>
        <type>click</type>
        <ownerObject>apbill</ownerObject>
        <label>View Details in Bill.com</label>
        <page>Header</page>
        <target>{!APBILL.BDC_URL_PREFIX!}/ViewBill?orgid={!APBILL.BDC_ORGID!}&amp;billid={!APBILL.BDC_BILLID!}</target>
        <renderDetails>
            <click>
                <condition>strlen({!APBILL.BDC_BILLID!}) &gt; 0 &amp;&amp; {!APBILL.TOTALENTERED!} &gt; 0</condition>
                <height></height>
                <width></width>
                <position></position>
                <resizeable>true</resizeable>
                <showAddressbar>true</showAddressbar>
                <showScrollbar>true</showScrollbar>
                <showToolbar>true</showToolbar>
                <showMenubar>true</showMenubar>
                <showStatusbar>true</showStatusbar>
            </click>
        </renderDetails>
    </smartLink>

    <smartLink>
    	<smartLinkId>VIEW_VENDOR_CREDIT_DETAILS_IN_BILLCOM</smartLinkId>
    	<type>click</type>
    	<ownerObject>apbill</ownerObject>
    	<label>View Details in Bill.com</label>
    	<page>Header</page>
    	<target>{!APBILL.BDC_URL_PREFIX!}/Login?directLogin=1&amp;orgId={!APBILL.BDC_ORGID!}&amp;url=%2FVendorCredit%3Fid%3D{!APBILL.BDC_BILLID!}</target>
		<renderDetails>
            <click>
                <condition>strlen({!APBILL.BDC_BILLID!}) &gt; 0 &amp;&amp; {!APBILL.TOTALENTERED!} &lt; 0</condition>
                <height></height>
                <width></width>
                <position></position>
                <resizeable>true</resizeable>
                <showAddressbar>true</showAddressbar>
                <showScrollbar>true</showScrollbar>
                <showToolbar>true</showToolbar>
                <showMenubar>true</showMenubar>
                <showStatusbar>true</showStatusbar>
            </click>
        </renderDetails>
	</smartLink>
    
    <smartLink>
        <smartLinkId>BDC_VIEW_INVOICE_DETAILS</smartLinkId>
        <type>click</type>
        <ownerObject>arinvoice</ownerObject>
        <label>View Details in Bill.com</label>
        <page>Header</page>
        <target>{!ARINVOICE.BDC_URL_PREFIX!}/Invoice?orgid={!APBILL.BDC_ORGID!}&amp;id={!ARINVOICE.BDC_INVOICEID!}</target>
        <renderDetails>
            <click>
                <condition>strlen({!ARINVOICE.BDC_INVOICEID!}) &gt; 0</condition>
                <height></height>
                <width></width>
                <position></position>
                <resizeable>true</resizeable>
                <showAddressbar>true</showAddressbar>
                <showScrollbar>true</showScrollbar>
                <showToolbar>true</showToolbar>
                <showMenubar>true</showMenubar>
                <showStatusbar>true</showStatusbar>
            </click>
        </renderDetails>
    </smartLink>


</smartLinks>

</customErpPackage> 

