1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 00:53:10 +01:00

bug fixes

This commit is contained in:
Hillel Coren 2014-02-03 12:34:58 +02:00
parent ea92b116d2
commit cd2c8147c1
7 changed files with 23 additions and 22 deletions

View File

@ -257,18 +257,18 @@ class Activity extends Eloquent
$client->paid_to_date = $client->paid_to_date + $payment->amount;
$client->save();
if (Auth::check())
{
$activity = Activity::getBlank();
$message = $payment->payment_type_id == PAYMENT_TYPE_CREDIT ? 'applied credit' : 'entered payment';
$activity->message = Utils::encodeActivity(Auth::user(), $message);
}
else
if ($payment->contact_id)
{
$activity = new Activity;
$activity->contact_id = $payment->contact_id;
$activity->message = Utils::encodeActivity($payment->invitation->contact, 'entered payment');
}
else
{
$activity = Activity::getBlank();
$message = $payment->payment_type_id == PAYMENT_TYPE_CREDIT ? 'applied credit' : 'entered payment';
$activity->message = Utils::encodeActivity(Auth::user(), $message);
}
$activity->payment_id = $payment->id;

View File

@ -217,7 +217,8 @@ define('DEFAULT_DATETIME_FORMAT', 'F j, Y, g:i a');
define('DEFAULT_QUERY_CACHE', 120);
if (Auth::check() && !Session::has(SESSION_TIMEZONE)) {
if (Auth::check() && !Session::has(SESSION_TIMEZONE))
{
Event::fire('user.refresh');
}

View File

@ -113,7 +113,7 @@
<tbody data-bind="sortable: { data: invoice_items, afterMove: onDragged }">
<tr data-bind="event: { mouseover: showActions, mouseout: hideActions }" class="sortable-row">
<td style="min-width:20px;" class="hide-border td-icon">
<i data-bind="visible: actionsVisible() &amp;&amp; $parent.invoice_items().length > 1" class="fa fa-sort"></i>
<i style="display:none" data-bind="visible: actionsVisible() &amp;&amp; $parent.invoice_items().length > 1" class="fa fa-sort"></i>
</td>
<td style="min-width:160px">
{{ Former::text('product_key')->useDatalist(Product::getProductKeys($products), 'key')->onkeyup('onItemChange()')
@ -128,13 +128,13 @@
<td style="min-width:120px">
<input onkeyup="onItemChange()" data-bind="value: prettyQty, valueUpdate: 'afterkeydown'" style="text-align: right" class="form-control"//>
</td>
<td style="min-width:120px; vertical-align:middle" data-bind="visible: $root.invoice_item_taxes.show">
<td style="display:none" style="min-width:120px; vertical-align:middle" data-bind="visible: $root.invoice_item_taxes.show">
<select class="form-control" style="width:100%" data-bind="value: tax, options: $root.tax_rates, optionsText: 'displayName'"></select>
</td>
<td style="min-width:120px;text-align: right;padding-top:9px !important">
<span data-bind="text: totals.total"></span>
</td>
<td style="min-width:20px; cursor:pointer" class="hide-border td-icon">
<td style="display:none" style="min-width:20px; cursor:pointer" class="hide-border td-icon">
&nbsp;<i data-bind="click: $parent.removeItem, visible: actionsVisible() &amp;&amp; $parent.invoice_items().length > 1" class="fa fa-minus-circle" title="Remove item"/>
</td>
</tr>
@ -157,17 +157,17 @@
<td colspan="2">Subtotal</td>
<td style="text-align: right"><span data-bind="text: totals.subtotal"/></td>
</tr>
<tr data-bind="visible: discount() > 0">
<tr style="display:none" data-bind="visible: discount() > 0">
<td class="hide-border" colspan="3"/>
<td class="hide-border" data-bind="visible: $root.invoice_item_taxes.show"/>
<td colspan="2">Discount</td>
<td style="text-align: right"><span data-bind="text: totals.discounted"/></td>
</tr>
<tr data-bind="visible: $root.invoice_taxes.show">
<tr style="display:none" data-bind="visible: $root.invoice_taxes.show">
<td class="hide-border" colspan="3"/>
<td class="hide-border" data-bind="visible: $root.invoice_item_taxes.show"/>
<td style="vertical-align: middle">Tax</td>
<td><select class="form-control" style="width:100%" data-bind="value: tax, options: $root.tax_rates, optionsText: 'displayName'"></select></td>
<td style="min-width:120px"><select class="form-control" style="width:100%" data-bind="value: tax, options: $root.tax_rates, optionsText: 'displayName'"></select></td>
<td style="vertical-align: middle; text-align: right"><span data-bind="text: totals.taxAmount"/></td>
</tr>
<tr>
@ -973,9 +973,12 @@
if (data) {
ko.mapping.fromJS(data, self.mapping, self);
self.is_recurring(parseInt(data.is_recurring));
console.log('is rec %s', parseInt(data.is_recurring));
} else {
self.addItem();
}
console.log('test')
self._tax = ko.observable();
this.tax = ko.computed({

View File

@ -147,7 +147,7 @@
<section class="hero2">
<div class="container">
<div class="caption">
<h1>SIMPLE, INTUITIVE INVOICING</h1>
<h1>SIMPLE, INTUITIVE INVOICING.</h1>
</div>
</div>
</section>

View File

@ -7,7 +7,7 @@ div.required > label {
}
label.checkbox,
div > label.control-label {
label.control-label {
font-weight: normal !important;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -294,7 +294,7 @@ function generatePDF(invoice, checkMath) {
doc.setLineWidth(1);
doc.line(tableLeft - tablePadding, x, lineTotalRight+tablePadding, x);
console.log('%s %s %s', lineTotalRight, tableLeft, (lineTotalRight-tableLeft));
//console.log('%s %s %s', lineTotalRight, tableLeft, (lineTotalRight-tableLeft));
doc.text(tableLeft, x+16, invoice.public_notes);
if (invoice.terms) {
@ -369,9 +369,6 @@ function generatePDF(invoice, checkMath) {
doc.setFontType("bold");
doc.text(footerLeft, x, 'Balance Due');
console.log('total %s', total);
console.log('inovice.amount %s', invoice.amount);
console.log('invoice.blance %s', invoice.balance);
total = formatMoney(total - (invoice.amount - invoice.balance), currencyId);
var totalX = headerRight - (doc.getStringUnitWidth(total) * doc.internal.getFontSize());
doc.text(totalX, x, total);
@ -872,7 +869,7 @@ function populateInvoiceComboboxes(clientId, invoiceId) {
if (invoiceId) {
var invoice = invoiceMap[invoiceId];
var client = clientMap[invoice.client.public_id];
console.log(invoice);
//console.log(invoice);
setComboboxValue($('.invoice-select'), invoice.public_id, (invoice.invoice_number + ' - ' + invoice.invoice_status.name + ' - ' + getClientDisplayName(client) + ' - ' + formatMoney(invoice.amount, invoice.currency_id) + ' | ' + formatMoney(invoice.balance, invoice.currency_id)));
$invoiceSelect.trigger('change');
} else if (clientId) {