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

Merge fixes

This commit is contained in:
Hillel Coren 2017-11-02 10:54:19 +02:00
parent a1e13ff7e1
commit fa95821375
6 changed files with 13 additions and 10 deletions

View File

@ -281,11 +281,13 @@ class WePayPaymentDriver extends BasePaymentDriver
'checkout_id' => intval($objectId),
]);
/*
if ($checkout->state == 'refunded') {
$payment->recordRefund();
} elseif (! empty($checkout->refund) && ! empty($checkout->refund->amount_refunded) && ($checkout->refund->amount_refunded - $payment->refunded) > 0) {
$payment->recordRefund($checkout->refund->amount_refunded - $payment->refunded);
}
*/
if ($checkout->state == 'captured') {
$payment->markComplete();

View File

@ -647,7 +647,8 @@ class ImportService
private function getCsvData($fileName)
{
$this->checkForFile($fileName);
$data = array_map('str_getcsv', file($fileName));
$file = file_get_contents($fileName);
$data = array_map("str_getcsv", preg_split('/\r*\n+|\r+/', $file));
if (count($data) > 0) {
$headers = $data[0];
@ -809,7 +810,9 @@ class ImportService
continue;
}
$obj->$field = $data[$index];
if (isset($data[$index])) {
$obj->$field = $data[$index];
}
}
return $obj;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -687,7 +687,7 @@ function calculateAmounts(invoice) {
// sum line item
for (var i=0; i<invoice.invoice_items.length; i++) {
var item = invoice.invoice_items[i];
var lineTotal = invoice.is_statement ? roundToTwo(NINJA.parseFloat(item.balance)) : roundSignificant(NINJA.parseFloat(item.cost)) * roundSignificant(NINJA.parseFloat(item.qty));
var lineTotal = invoice.is_statement ? roundToTwo(NINJA.parseFloat(item.balance)) : roundSignificant(NINJA.parseFloat(item.cost) * NINJA.parseFloat(item.qty));
lineTotal = roundToTwo(lineTotal);
if (lineTotal) {
total += lineTotal;
@ -740,7 +740,7 @@ function calculateAmounts(invoice) {
}
// calculate line item tax
var lineTotal = roundToFour(NINJA.parseFloat(item.cost)) * roundToFour(NINJA.parseFloat(item.qty));
var lineTotal = roundSignificant(NINJA.parseFloat(item.cost) * NINJA.parseFloat(item.qty));
if (invoice.discount != 0) {
if (parseInt(invoice.is_amount_discount)) {
lineTotal -= roundToTwo((lineTotal/total) * invoice.discount);

View File

@ -870,9 +870,7 @@ function ItemModel(data) {
this.totals = ko.observable();
this.totals.rawTotal = ko.computed(function() {
var cost = roundSignificant(NINJA.parseFloat(self.cost()));
var qty = roundSignificant(NINJA.parseFloat(self.qty()));
var value = cost * qty;
var value = roundSignificant(NINJA.parseFloat(self.cost()) * NINJA.parseFloat(self.qty()));
return value ? roundToTwo(value) : 0;
});