Working on UBL

This commit is contained in:
Hillel Coren 2018-01-12 15:15:58 +02:00
parent 889388eb9a
commit d0bd49e0a6
7 changed files with 26 additions and 11 deletions

View File

@ -106,7 +106,7 @@ class ConvertInvoiceToUbl extends Job
if ($item->tax_name1 || $item->tax_rate1) { if ($item->tax_name1 || $item->tax_rate1) {
$taxtotal = (new TaxTotal()) $taxtotal = (new TaxTotal())
->setTaxAmount(10) ->setTaxAmount(10)
->setTaxSubTotal((new TaxSubTotal()) ->addTaxSubTotal((new TaxSubTotal())
->setTaxAmount(10) ->setTaxAmount(10)
->setTaxableAmount(100) ->setTaxableAmount(100)
->setTaxCategory((new TaxCategory()) ->setTaxCategory((new TaxCategory())
@ -124,7 +124,7 @@ class ConvertInvoiceToUbl extends Job
if ($invoice->tax_name1 || $invoice->tax_rate1) { if ($invoice->tax_name1 || $invoice->tax_rate1) {
$taxtotal = (new TaxTotal()) $taxtotal = (new TaxTotal())
->setTaxAmount(10) ->setTaxAmount(10)
->setTaxSubTotal((new TaxSubTotal()) ->addTaxSubTotal((new TaxSubTotal())
->setTaxAmount(10) ->setTaxAmount(10)
->setTaxableAmount(100) ->setTaxableAmount(100)
->setTaxCategory((new TaxCategory()) ->setTaxCategory((new TaxCategory())

View File

@ -146,6 +146,7 @@ class Account extends Eloquent
'invoice_fields', 'invoice_fields',
'invoice_embed_documents', 'invoice_embed_documents',
'document_email_attachment', 'document_email_attachment',
'ubl_email_attachment',
'enable_client_portal_dashboard', 'enable_client_portal_dashboard',
'page_size', 'page_size',
'live_preview', 'live_preview',

View File

@ -25,7 +25,7 @@
"barryvdh/laravel-ide-helper": "~2.2", "barryvdh/laravel-ide-helper": "~2.2",
"cerdic/css-tidy": "~v1.5", "cerdic/css-tidy": "~v1.5",
"chumper/datatable": "dev-develop#04ef2bf", "chumper/datatable": "dev-develop#04ef2bf",
"cleverit/ubl_invoice": "^0.1.1", "cleverit/ubl_invoice": "1.*",
"codedge/laravel-selfupdater": "5.x-dev", "codedge/laravel-selfupdater": "5.x-dev",
"collizo4sky/omnipay-wepay": "dev-address-fix", "collizo4sky/omnipay-wepay": "dev-address-fix",
"digitickets/omnipay-gocardlessv2": "dev-payment-fix", "digitickets/omnipay-gocardlessv2": "dev-payment-fix",

14
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "a0b0eb9c2d63d3d2cbd24eb98f18f001", "hash": "cb8a64c60286537ef9f496d1fb7b17d6",
"content-hash": "231a35f4b2351f92f781e063b965e861", "content-hash": "b74be03e96ee322cbf4ddf19ed15686d",
"packages": [ "packages": [
{ {
"name": "abdala/omnipay-pagseguro", "name": "abdala/omnipay-pagseguro",
@ -1085,16 +1085,16 @@
}, },
{ {
"name": "cleverit/ubl_invoice", "name": "cleverit/ubl_invoice",
"version": "v0.1.1", "version": "v1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/CleverIT/UBL_invoice.git", "url": "https://github.com/CleverIT/UBL_invoice.git",
"reference": "81931c88732393cef78afa78c8c33fc7a9024843" "reference": "3c4ec1dd8dc826d6c8302e191565b8ac1a947022"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/CleverIT/UBL_invoice/zipball/81931c88732393cef78afa78c8c33fc7a9024843", "url": "https://api.github.com/repos/CleverIT/UBL_invoice/zipball/3c4ec1dd8dc826d6c8302e191565b8ac1a947022",
"reference": "81931c88732393cef78afa78c8c33fc7a9024843", "reference": "3c4ec1dd8dc826d6c8302e191565b8ac1a947022",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1133,7 +1133,7 @@
"xml", "xml",
"xml invoice" "xml invoice"
], ],
"time": "2017-01-17 09:08:26" "time": "2018-01-11 19:26:20"
}, },
{ {
"name": "codedge/laravel-selfupdater", "name": "codedge/laravel-selfupdater",

View File

@ -16,6 +16,10 @@ class AddSubscriptionFormat extends Migration
Schema::table('subscriptions', function ($table) { Schema::table('subscriptions', function ($table) {
$table->enum('format', ['JSON', 'UBL'])->default('JSON'); $table->enum('format', ['JSON', 'UBL'])->default('JSON');
}); });
Schema::table('accounts', function ($table) {
$table->boolean('ubl_email_attachment')->default(false);
});
} }
/** /**
@ -28,5 +32,9 @@ class AddSubscriptionFormat extends Migration
Schema::table('subscriptions', function ($table) { Schema::table('subscriptions', function ($table) {
$table->dropColumn('format'); $table->dropColumn('format');
}); });
Schema::table('accounts', function ($table) {
$table->dropColumn('ubl_email_attachment');
});
} }
} }

View File

@ -186,7 +186,7 @@ $LANG = array(
'clients_will_create' => 'clients will be created', 'clients_will_create' => 'clients will be created',
'email_settings' => 'Email Settings', 'email_settings' => 'Email Settings',
'client_view_styling' => 'Client View Styling', 'client_view_styling' => 'Client View Styling',
'pdf_email_attachment' => 'Attach Invoice', 'pdf_email_attachment' => 'Attach PDF',
'custom_css' => 'Custom CSS', 'custom_css' => 'Custom CSS',
'import_clients' => 'Import Client Data', 'import_clients' => 'Import Client Data',
'csv_file' => 'CSV file', 'csv_file' => 'CSV file',
@ -1104,6 +1104,7 @@ $LANG = array(
'invoice_embed_documents' => 'Embed Documents', 'invoice_embed_documents' => 'Embed Documents',
'invoice_embed_documents_help' => 'Include attached images in the invoice.', 'invoice_embed_documents_help' => 'Include attached images in the invoice.',
'document_email_attachment' => 'Attach Documents', 'document_email_attachment' => 'Attach Documents',
'ubl_email_attachment' => 'Attach UBL',
'download_documents' => 'Download Documents (:size)', 'download_documents' => 'Download Documents (:size)',
'documents_from_expenses' => 'From Expenses:', 'documents_from_expenses' => 'From Expenses:',
'dropzone_default_message' => 'Drop files or click to upload', 'dropzone_default_message' => 'Drop files or click to upload',

View File

@ -24,6 +24,7 @@
{{ Former::populate($account) }} {{ Former::populate($account) }}
{{ Former::populateField('pdf_email_attachment', intval($account->pdf_email_attachment)) }} {{ Former::populateField('pdf_email_attachment', intval($account->pdf_email_attachment)) }}
{{ Former::populateField('ubl_email_attachment', intval($account->ubl_email_attachment)) }}
{{ Former::populateField('document_email_attachment', intval($account->document_email_attachment)) }} {{ Former::populateField('document_email_attachment', intval($account->document_email_attachment)) }}
{{ Former::populateField('enable_email_markup', intval($account->enable_email_markup)) }} {{ Former::populateField('enable_email_markup', intval($account->enable_email_markup)) }}
{{ Former::populateField('bcc_email', $account->account_email_settings->bcc_email) }} {{ Former::populateField('bcc_email', $account->account_email_settings->bcc_email) }}
@ -52,6 +53,10 @@
'link_docs' => link_to('http://docs.invoiceninja.com/en/latest/configure.html#phantomjs', 'PhantomJS', ['target' => '_blank']) 'link_docs' => link_to('http://docs.invoiceninja.com/en/latest/configure.html#phantomjs', 'PhantomJS', ['target' => '_blank'])
])) : false) !!} ])) : false) !!}
{!! Former::checkbox('ubl_email_attachment')
->text(trans('texts.enable'))
->value(1) !!}
{!! Former::checkbox('document_email_attachment') {!! Former::checkbox('document_email_attachment')
->text(trans('texts.enable')) ->text(trans('texts.enable'))
->value(1) !!} ->value(1) !!}