Operation Billing
Estimated reading: 1 minute
This article will explain how to configure a button that opens the invoice form, linking it directly to the ticket.
As a first step you will need to create the button, this will open a floating window with the pre-filled invoice data.
In the interested formtemplate we click the pencil icon in the upper left side.
In the floating window that will open, right-click on “Buttons” (1) and click “New Button”.
$url = Deep::getUrl('*/sales_invoice/new', [
'type' => 1,
'only_content' => 1,
]);
$operation = Deep::registry('current_model_instance');
$accountId = Deep::getModel('deep_company/company')->load($operation->getRequesterCompanyId())->getAccountId();
$urlParms = http_build_query([
'invoice[model_id]' => $operation->getId(),
'invoice[model_alias]' => 'deep_service/operation',
'invoice[account_id]' => $accountId,
'invoice[name]' => 'Invoice Operation #'.$operation->getId()
]);
$url = $url . "?" . $urlParms;
$jsFloating = <<
With this configuration, when the Invoice button is clicked, a floating window will be opened to create the already pre-filled invoice.