diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index cc33f585a262..485f2a3f2888 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -124,12 +124,8 @@ class InvoiceController extends BaseController $invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date); $invoice->due_date = Utils::fromSqlDate($invoice->due_date); $invoice->is_pro = $account->isPro(); -<<<<<<< HEAD - -======= $invoice->invoice_fonts = $account->getFontsData(); - ->>>>>>> cf24684adbce402f1c0e266672c4a2a5767dc754 + if ($invoice->invoice_design_id == CUSTOM_DESIGN) { $invoice->invoice_design->javascript = $account->custom_design; } else { @@ -364,7 +360,7 @@ class InvoiceController extends BaseController $recurringHelp .= $line; } } - + $recurringDueDateHelp = ''; foreach (preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_due_date_help')) as $line) { $parts = explode("=>", $line); @@ -380,20 +376,20 @@ class InvoiceController extends BaseController $recurringDueDates = array( trans('texts.use_client_terms') => array('value' => '', 'class' => 'monthly weekly'), ); - + $ends = array('th','st','nd','rd','th','th','th','th','th','th'); for($i = 1; $i < 31; $i++){ if ($i >= 11 && $i <= 13) $ordinal = $i. 'th'; else $ordinal = $i . $ends[$i % 10]; - + $dayStr = str_pad($i, 2, '0', STR_PAD_LEFT); $str = trans('texts.day_of_month', array('ordinal'=>$ordinal)); - + $recurringDueDates[$str] = array('value' => "1998-01-$dayStr", 'data-num' => $i, 'class' => 'monthly'); } $recurringDueDates[trans('texts.last_day_of_month')] = array('value' => "1998-01-31", 'data-num' => 31, 'class' => 'monthly'); - - + + $daysOfWeek = array( trans('texts.sunday'), trans('texts.monday'), @@ -406,13 +402,13 @@ class InvoiceController extends BaseController foreach(array('1st','2nd','3rd','4th') as $i=>$ordinal){ foreach($daysOfWeek as $j=>$dayOfWeek){ $str = trans('texts.day_of_week_after', array('ordinal' => $ordinal, 'day' => $dayOfWeek)); - + $day = $i * 7 + $j + 1; $dayStr = str_pad($day, 2, '0', STR_PAD_LEFT); $recurringDueDates[$str] = array('value' => "1998-02-$dayStr", 'data-num' => $day, 'class' => 'weekly'); } } - + return [ 'data' => Input::old('data'), 'account' => Auth::user()->account->load('country'), diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 9062df55e8cc..d07ba551d29d 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -992,7 +992,7 @@ return array( 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', - + 'token_expired' => 'Validation token was expired. Please try again.', 'invoice_link' => 'Invoice Link', 'button_confirmation_message' => 'Click to confirm your email address.', @@ -1012,7 +1012,7 @@ return array( 'white_label_custom_css' => ':link for $'.WHITE_LABEL_PRICE.' to enable custom styling and help support our project.', 'white_label_purchase_link' => 'Purchase a white label license', -<<<<<<< HEAD + // Expense / vendor 'expense' => 'Expense', @@ -1061,9 +1061,8 @@ return array( 'edit_payment_terms' => 'Edit payment term', 'edit_payment_term' => 'Edit payment term', 'archive_payment_term' => 'Archive payment term', -); -======= - + + // recurring due dates 'recurring_due_dates' => 'Recurring Invoice Due Dates', 'recurring_due_date_help' => '

Automatically sets a due date for the invoice.

@@ -1106,4 +1105,4 @@ return array( 'payment_message_button' => 'Thank you for your payment of :amount.', ); ->>>>>>> cf24684adbce402f1c0e266672c4a2a5767dc754 + diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index c778743d9dad..46cc54e80efe 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -175,10 +175,10 @@ @if ($account->showCustomField('custom_invoice_text_label2', $invoice)) {!! Former::text('custom_text_value2')->label($account->custom_invoice_text_label2)->data_bind("value: custom_text_value2, valueUpdate: 'afterkeydown'") !!} @endif - + @if ($entityType == ENTITY_INVOICE)
-
+
@if ($invoice->recurring_invoice) {!! trans('texts.created_by_invoice', ['invoice' => link_to('/invoices/'.$invoice->recurring_invoice->public_id, trans('texts.recurring_invoice'))]) !!} @elseif ($invoice->id) @@ -628,7 +628,7 @@
- + @@ -673,7 +673,7 @@ var $clientSelect = $('select#client'); var invoiceDesigns = {!! $invoiceDesigns !!}; var invoiceFonts = {!! $invoiceFonts !!}; - + $(function() { // create client dictionary @@ -892,20 +892,17 @@ @endif applyComboboxListeners(); -<<<<<<< HEAD }); -======= - }); - + function onFrequencyChange(){ var currentName = $('#frequency_id').find('option:selected').text() var currentDueDateNumber = $('#recurring_due_date').find('option:selected').attr('data-num'); var optionClass = currentName && currentName.toLowerCase().indexOf('week') > -1 ? 'weekly' : 'monthly'; var replacementOption = $('#recurring_due_date option[data-num=' + currentDueDateNumber + '].' + optionClass); - + $('#recurring_due_date option').hide(); $('#recurring_due_date option.' + optionClass).show(); - + // Switch to an equivalent option if(replacementOption.length){ replacementOption.attr('selected','selected'); @@ -914,7 +911,6 @@ $('#recurring_due_date').val(''); } } ->>>>>>> cf24684adbce402f1c0e266672c4a2a5767dc754 function applyComboboxListeners() { var selectorStr = '.invoice-table input, .invoice-table textarea';