forked from InvoicePlane/InvoicePlane
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'InvoicePlane:development' into Preview-PDF-in-Modal-Inv…
- Loading branch information
Showing
34 changed files
with
1,549 additions
and
949 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
if (!defined('BASEPATH')) { | ||
exit('No direct script access allowed'); | ||
} | ||
|
||
use SepaQr\Data; | ||
use Endroid\QrCode\Builder\Builder; | ||
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelMedium; | ||
|
||
class QrCode { | ||
public $invoice; | ||
public $recipient; | ||
public $iban; | ||
public $bic; | ||
public $currencyCode; | ||
public $remittance_text; | ||
|
||
public function __construct($params) { | ||
$CI = &get_instance(); | ||
|
||
$CI->load->helper('template'); | ||
|
||
$this->invoice = $params['invoice']; | ||
$this->recipient = $CI->mdl_settings->setting('qr_code_recipient'); | ||
$this->iban = $CI->mdl_settings->setting('qr_code_iban'); | ||
$this->bic = $CI->mdl_settings->setting('qr_code_bic'); | ||
$this->currencyCode = $CI->mdl_settings->setting('currency_code'); | ||
$this->remittance_text = parse_template( | ||
$this->invoice, | ||
$CI->mdl_settings->setting('qr_code_remittance_text') | ||
); | ||
} | ||
|
||
public function paymentData() { | ||
$paymentData = Data::create() | ||
->setName($this->recipient) | ||
->setIban($this->iban) | ||
->setBic($this->bic) | ||
->setCurrency($this->currencyCode) | ||
->setRemittanceText($this->remittance_text) | ||
->setAmount($this->invoice->invoice_total); | ||
|
||
return $paymentData; | ||
} | ||
|
||
public function generate() { | ||
$qrCodeDataUri = Builder::create() | ||
->data($this->paymentData()) | ||
->errorCorrectionLevel(new ErrorCorrectionLevelMedium()) // required by EPC standard | ||
->build() | ||
->getDataUri(); | ||
|
||
return $qrCodeDataUri; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
application/modules/email_templates/views/template-tags-invoices.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div class="form-group"> | ||
<label for="tags_invoice"><?php _trans('invoices'); ?></label> | ||
<select id="tags_invoice" class="tag-select form-control"> | ||
<option value="{{{invoice_number}}}"> | ||
<?php _trans('id'); ?> | ||
</option> | ||
<option value="{{{invoice_status}}}"> | ||
<?php _trans('status'); ?> | ||
</option> | ||
<optgroup label="<?php _trans('invoice_dates'); ?>"> | ||
<option value="{{{invoice_date_due}}}"> | ||
<?php _trans('due_date'); ?> | ||
</option> | ||
<option value="{{{invoice_date_created}}}"> | ||
<?php _trans('invoice_date'); ?> | ||
</option> | ||
</optgroup> | ||
<optgroup label="<?php _trans('invoice_amounts'); ?>"> | ||
<option value="{{{invoice_item_subtotal}}}"> | ||
<?php _trans('subtotal'); ?> | ||
</option> | ||
<option value="{{{invoice_item_tax_total}}}"> | ||
<?php _trans('invoice_tax'); ?> | ||
</option> | ||
<option value="{{{invoice_total}}}"> | ||
<?php _trans('total'); ?> | ||
</option> | ||
<option value="{{{invoice_paid}}}"> | ||
<?php _trans('total_paid'); ?> | ||
</option> | ||
<option value="{{{invoice_balance}}}"> | ||
<?php _trans('balance'); ?> | ||
</option> | ||
</optgroup> | ||
<optgroup label="<?php _trans('extra_information'); ?>"> | ||
<option value="{{{invoice_terms}}}"> | ||
<?php _trans('invoice_terms'); ?> | ||
</option> | ||
<option value="{{{invoice_guest_url}}}"> | ||
<?php _trans('guest_url'); ?> | ||
</option> | ||
<!-- <option value="{{{payment_method}}}"> --> | ||
<!-- <?php _trans('payment_method'); ?> --> | ||
<!-- </option> --> | ||
</optgroup> | ||
|
||
<optgroup label="<?php _trans('custom_fields'); ?>"> | ||
<?php foreach ($custom_fields['ip_invoice_custom'] as $custom) { ?> | ||
<option value="{{{<?php echo 'ip_cf_' . $custom->custom_field_id; ?>}}}"> | ||
<?php echo $custom->custom_field_label . ' (ID ' . $custom->custom_field_id . ')'; ?> | ||
</option> | ||
<?php } ?> | ||
</optgroup> | ||
</select> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.