mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Fix for UBL invoices
This commit is contained in:
parent
26c1799043
commit
b66a9b2a33
@ -57,22 +57,17 @@ class ConvertInvoiceToUbl extends Job
|
|||||||
|
|
||||||
$ublInvoice->setInvoiceLines($invoiceLines);
|
$ublInvoice->setInvoiceLines($invoiceLines);
|
||||||
|
|
||||||
if ($invoice->hasTaxes()) {
|
$taxtotal = new TaxTotal();
|
||||||
$taxtotal = new TaxTotal();
|
$taxAmount1 = $taxAmount2 = 0;
|
||||||
$taxAmount1 = $taxAmount2 = 0;
|
|
||||||
|
|
||||||
if ($invoice->tax_name1 || floatval($invoice->tax_rate1)) {
|
$taxAmount1 = $this->createTaxRate($taxtotal, $taxable, $invoice->tax_rate1, $invoice->tax_name1);
|
||||||
$taxAmount1 = $this->createTaxRate($taxtotal, $taxable, $invoice->tax_rate1, $invoice->tax_name1);
|
if ($invoice->tax_name2 || floatval($invoice->tax_rate2)) {
|
||||||
}
|
$taxAmount2 = $this->createTaxRate($taxtotal, $taxable, $invoice->tax_rate2, $invoice->tax_name2);
|
||||||
|
|
||||||
if ($invoice->tax_name2 || floatval($invoice->tax_rate2)) {
|
|
||||||
$taxAmount2 = $this->createTaxRate($taxtotal, $taxable, $invoice->tax_rate2, $invoice->tax_name2);
|
|
||||||
}
|
|
||||||
|
|
||||||
$taxtotal->setTaxAmount($taxAmount1 + $taxAmount2);
|
|
||||||
$ublInvoice->setTaxTotal($taxtotal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$taxtotal->setTaxAmount($taxAmount1 + $taxAmount2);
|
||||||
|
$ublInvoice->setTaxTotal($taxtotal);
|
||||||
|
|
||||||
$ublInvoice->setLegalMonetaryTotal((new LegalMonetaryTotal())
|
$ublInvoice->setLegalMonetaryTotal((new LegalMonetaryTotal())
|
||||||
//->setLineExtensionAmount()
|
//->setLineExtensionAmount()
|
||||||
->setTaxExclusiveAmount($taxable)
|
->setTaxExclusiveAmount($taxable)
|
||||||
@ -118,22 +113,17 @@ class ConvertInvoiceToUbl extends Job
|
|||||||
->setDescription($item->description));
|
->setDescription($item->description));
|
||||||
//->setSellersItemIdentification("1ABCD"));
|
//->setSellersItemIdentification("1ABCD"));
|
||||||
|
|
||||||
if ($item->hasTaxes()) {
|
$taxtotal = new TaxTotal();
|
||||||
$taxtotal = new TaxTotal();
|
$itemTaxAmount1 = $itemTaxAmount2 = 0;
|
||||||
$itemTaxAmount1 = $itemTaxAmount2 = 0;
|
|
||||||
|
|
||||||
if ($item->tax_name1 || floatval($item->tax_rate1)) {
|
$itemTaxAmount1 = $this->createTaxRate($taxtotal, $taxable, $item->tax_rate1, $item->tax_name1);
|
||||||
$itemTaxAmount1 = $this->createTaxRate($taxtotal, $taxable, $item->tax_rate1, $item->tax_name1);
|
if ($item->tax_name2 || floatval($item->tax_rate2)) {
|
||||||
}
|
$itemTaxAmount2 = $this->createTaxRate($taxtotal, $taxable, $item->tax_rate2, $item->tax_name2);
|
||||||
|
|
||||||
if ($item->tax_name2 || floatval($item->tax_rate2)) {
|
|
||||||
$itemTaxAmount2 = $this->createTaxRate($taxtotal, $taxable, $item->tax_rate2, $item->tax_name2);
|
|
||||||
}
|
|
||||||
|
|
||||||
$taxtotal->setTaxAmount($itemTaxAmount1 + $itemTaxAmount2);
|
|
||||||
$invoiceLine->setTaxTotal($taxtotal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$taxtotal->setTaxAmount($itemTaxAmount1 + $itemTaxAmount2);
|
||||||
|
$invoiceLine->setTaxTotal($taxtotal);
|
||||||
|
|
||||||
return $invoiceLine;
|
return $invoiceLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,10 +127,10 @@ class Mailer
|
|||||||
|
|
||||||
// Handle invoice attachments
|
// Handle invoice attachments
|
||||||
if (! empty($data['pdfString']) && ! empty($data['pdfFileName'])) {
|
if (! empty($data['pdfString']) && ! empty($data['pdfFileName'])) {
|
||||||
$attachments[] = PostmarkAttachment::fromRawData($document['pdfString'], $document['pdfFileName']);
|
$attachments[] = PostmarkAttachment::fromRawData($data['pdfString'], $data['pdfFileName']);
|
||||||
}
|
}
|
||||||
if (! empty($data['ublString']) && ! empty($data['ublFileName'])) {
|
if (! empty($data['ublString']) && ! empty($data['ublFileName'])) {
|
||||||
$attachments[] = PostmarkAttachment::fromRawData($document['ublString'], $document['ublFileName']);
|
$attachments[] = PostmarkAttachment::fromRawData($data['ublString'], $data['ublFileName']);
|
||||||
}
|
}
|
||||||
if (! empty($data['documents'])) {
|
if (! empty($data['documents'])) {
|
||||||
foreach ($data['documents'] as $document) {
|
foreach ($data['documents'] as $document) {
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
defaultDate: '{{ date('Y-m-d') }}',
|
defaultDate: '{{ date('Y-m-d') }}',
|
||||||
eventLimit: true,
|
eventLimit: true,
|
||||||
events: {
|
events: {
|
||||||
url: '{{ url('/calendar_events') }}',
|
url: '{{ url('/reports/calendar_events') }}',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</a>
|
</a>
|
||||||
@elseif ($option == 'reports')
|
@elseif ($option == 'reports')
|
||||||
<a type="button" class="btn btn-default btn-sm pull-right" title="{{ trans('texts.calendar') }}"
|
<a type="button" class="btn btn-default btn-sm pull-right" title="{{ trans('texts.calendar') }}"
|
||||||
href="{{ url('/calendar') }}">
|
href="{{ url('/reports/calendar') }}">
|
||||||
<i class="fa fa-calendar" style="width:20px"></i>
|
<i class="fa fa-calendar" style="width:20px"></i>
|
||||||
</a>
|
</a>
|
||||||
@elseif (Auth::user()->can('create', $option) || Auth::user()->can('create', substr($option, 0, -1)))
|
@elseif (Auth::user()->can('create', $option) || Auth::user()->can('create', substr($option, 0, -1)))
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
->appendIcon(Icon::create('envelope')) !!}
|
->appendIcon(Icon::create('envelope')) !!}
|
||||||
@endif
|
@endif
|
||||||
{!! Button::normal(trans('texts.calendar'))
|
{!! Button::normal(trans('texts.calendar'))
|
||||||
->asLinkTo(url('/calendar'))
|
->asLinkTo(url('/reports/calendar'))
|
||||||
->appendIcon(Icon::create('calendar')) !!}
|
->appendIcon(Icon::create('calendar')) !!}
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
|
@ -283,8 +283,8 @@ Route::group(['middleware' => ['lookup:user', 'auth:user']], function () {
|
|||||||
|
|
||||||
Route::get('reports', 'ReportController@showReports');
|
Route::get('reports', 'ReportController@showReports');
|
||||||
Route::post('reports', 'ReportController@showReports');
|
Route::post('reports', 'ReportController@showReports');
|
||||||
Route::get('calendar', 'CalendarController@showCalendar');
|
Route::get('reports/calendar', 'CalendarController@showCalendar');
|
||||||
Route::get('calendar_events', 'CalendarController@loadEvents');
|
Route::get('reports/calendar_events', 'CalendarController@loadEvents');
|
||||||
Route::get('reports/emails', 'ReportController@showEmailReport');
|
Route::get('reports/emails', 'ReportController@showEmailReport');
|
||||||
Route::get('reports/emails_report/{start_date}/{end_date}', 'ReportController@loadEmailReport');
|
Route::get('reports/emails_report/{start_date}/{end_date}', 'ReportController@loadEmailReport');
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user