diff --git a/app/Import/Transformers/Csv/InvoiceTransformer.php b/app/Import/Transformers/Csv/InvoiceTransformer.php index 5365a08365d1..b6fee5536319 100644 --- a/app/Import/Transformers/Csv/InvoiceTransformer.php +++ b/app/Import/Transformers/Csv/InvoiceTransformer.php @@ -45,7 +45,7 @@ class InvoiceTransformer extends BaseTransformer { 'client_id' => $this->getClient( $this->getString( $invoice_data, 'client.name' ), $this->getString( $invoice_data, 'client.email' ) ), 'discount' => $this->getFloat( $invoice_data, 'invoice.discount' ), 'po_number' => $this->getString( $invoice_data, 'invoice.po_number' ), - 'date' => isset( $invoice_data['invoice.date'] ) ? date( 'Y-m-d', strtotime( $invoice_data['invoice.date'] ) ) : null, + 'date' => isset( $invoice_data['invoice.date'] ) ? date( 'Y-m-d', strtotime( $invoice_data['invoice.date'] ) ) : now()->format('Y-m-d'), 'due_date' => isset( $invoice_data['invoice.due_date'] ) ? date( 'Y-m-d', strtotime( $invoice_data['invoice.due_date'] ) ) : null, 'terms' => $this->getString( $invoice_data, 'invoice.terms' ), 'public_notes' => $this->getString( $invoice_data, 'invoice.public_notes' ), diff --git a/app/PaymentDrivers/Stripe/Utilities.php b/app/PaymentDrivers/Stripe/Utilities.php index dd04e64aec21..77493dbf6851 100644 --- a/app/PaymentDrivers/Stripe/Utilities.php +++ b/app/PaymentDrivers/Stripe/Utilities.php @@ -18,7 +18,7 @@ trait Utilities public function convertFromStripeAmount($amount, $precision, $currency) { - if(in_array($amount, ["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"])) + if(in_array($currency->code, ["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"])) return $amount; return $amount / pow(10, $precision); @@ -28,7 +28,7 @@ trait Utilities public function convertToStripeAmount($amount, $precision, $currency) { - if(in_array($amount, ["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"])) + if(in_array($currency->code, ["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"])) return $amount; return round(($amount * pow(10, $precision)),0);