Merge branch 'master' of https://github.com/bagisto/bagisto into development

This commit is contained in:
Prashant Singh 2019-05-24 16:49:47 +05:30
commit 79ba3ebcf3
24 changed files with 300 additions and 18 deletions

View File

@ -68,9 +68,34 @@ return [
'name' => 'admin::app.admin.system.general',
'sort' => 4,
], [
'key' => 'general.general',
'name' => 'admin::app.admin.system.general',
'sort' => 1,
], [
'key' => 'general.general.locale_options',
'name' => 'admin::app.admin.system.locale-options',
'sort' => 1,
'fields' => [
[
'name' => 'weight_unit',
'title' => 'admin::app.admin.system.weight-unit',
'type' => 'select',
'options' => [
[
'title' => 'lbs',
'value' => 'lbs'
], [
'title' => 'kgs',
'value' => 'kgs'
]
],
'channel_based' => true,
]
]
],[
'key' => 'general.content',
'name' => 'admin::app.admin.system.content',
'sort' => 1,
'sort' => 2,
], [
'key' => 'general.content.footer',
'name' => 'admin::app.admin.system.footer',

View File

@ -266,9 +266,11 @@ return [
'total' => 'المجموع',
'subtotal' => 'المجموع الفرعي',
'shipping-handling' => 'الشحن والمناولة',
'discount' => 'Discount',
'tax' => 'الضرائب',
'tax-percent' => 'نسبة الضرائب',
'tax-amount' => 'المبلغ الضريبي',
'discount-amount' => 'Discount Amount',
'discount-amount' => 'مبلغ الخصم',
'grand-total' => 'المجموع الكلي',
'total-paid' => 'المجموع المدفوع',

View File

@ -285,10 +285,12 @@ return [
'total' => 'Total',
'subtotal' => 'Subtotal',
'shipping-handling' => 'Shipping & Handling',
'discount' => 'Discount',
'tax' => 'Tax',
'tax-percent' => 'Tax Percent',
'tax-amount' => 'Tax Amount',
'discount-amount' => 'Discount Amount',
'discount-amount' => 'Discount Amount',
'grand-total' => 'Grand Total',
'total-paid' => 'Total Paid',
'total-refunded' => 'Total Refunded',
@ -956,7 +958,9 @@ return [
'general' => 'General',
'footer' => 'Footer',
'content' => 'Content',
'footer-content' => 'Text Value'
'footer-content' => 'Footer Text',
'locale-options' => 'Locale Options',
'weight-unit' => 'Weight Unit'
]
]
];

View File

@ -273,9 +273,11 @@ return [
'total' => 'Total',
'subtotal' => 'Subtotal',
'shipping-handling' => 'Entrega & Manuseio',
'discount' => 'Discount',
'tax' => 'Imposto',
'tax-percent' => 'Percentual Imposto',
'tax-amount' => 'Valor de Imposto',
'discount-amount' => 'Discount Amount',
'discount-amount' => 'Valor de Desconto',
'grand-total' => 'Total',
'total-paid' => 'Total Pago',

View File

@ -146,14 +146,14 @@
<td>
<div class="control-group" :class="[errors.has(variantInputName + '[price]') ? 'has-error' : '']">
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.price" :name="[variantInputName + '[price]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.price') }}&quot;"/>
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.price" :name="[variantInputName + '[price]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.price') }}&quot;" step="any"/>
<span class="control-error" v-if="errors.has(variantInputName + '[price]')">@{{ errors.first(variantInputName + '[price]') }}</span>
</div>
</td>
<td>
<div class="control-group" :class="[errors.has(variantInputName + '[weight]') ? 'has-error' : '']">
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.weight" :name="[variantInputName + '[weight]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.weight') }}&quot;"/>
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.weight" :name="[variantInputName + '[weight]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.weight') }}&quot;" step="any"/>
<span class="control-error" v-if="errors.has(variantInputName + '[weight]')">@{{ errors.first(variantInputName + '[weight]') }}</span>
</div>
</td>

View File

@ -88,7 +88,11 @@
<div class="footer">
<p>
{{ core()->getConfigData('general.content.footer.footer_content') }}
@if (core()->getConfigData('general.content.footer.footer_content'))
{{ core()->getConfigData('general.content.footer.footer_content') }}
@else
{{ trans('admin::app.footer.copy-right') }}
@endif
</p>
</div>

View File

@ -216,6 +216,9 @@
<th>{{ __('admin::app.sales.orders.qty') }}</th>
<th>{{ __('admin::app.sales.orders.subtotal') }}</th>
<th>{{ __('admin::app.sales.orders.tax-amount') }}</th>
@if ($invoice->base_discount_amount > 0)
<th>{{ __('admin::app.sales.orders.discount-amount') }}</th>
@endif
<th>{{ __('admin::app.sales.orders.grand-total') }}</th>
</tr>
</thead>
@ -225,6 +228,7 @@
@foreach ($invoice->items as $item)
<tr>
<td>{{ $item->child ? $item->child->sku : $item->sku }}</td>
<td>
{{ $item->name }}
@ -232,10 +236,19 @@
<p>{{ $html }}</p>
@endif
</td>
<td>{{ core()->formatBasePrice($item->base_price) }}</td>
<td>{{ $item->qty }}</td>
<td>{{ core()->formatBasePrice($item->base_total) }}</td>
<td>{{ core()->formatBasePrice($item->base_tax_amount) }}</td>
@if ($invoice->base_discount_amount > 0)
<td>{{ core()->formatBasePrice($item->base_discount_amount) }}</td>
@endif
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount) }}</td>
</tr>
@endforeach
@ -263,6 +276,14 @@
<td>{{ core()->formatBasePrice($invoice->base_tax_amount) }}</td>
</tr>
@if ($invoice->base_discount_amount > 0)
<tr>
<td>{{ __('admin::app.sales.orders.discount') }}</td>
<td>-</td>
<td>-{{ core()->formatBasePrice($invoice->base_discount_amount) }}</td>
</tr>
@endif
<tr class="bold">
<td>{{ __('admin::app.sales.orders.grand-total') }}</td>
<td>-</td>

View File

@ -236,6 +236,9 @@
<th>{{ __('admin::app.sales.orders.subtotal') }}</th>
<th>{{ __('admin::app.sales.orders.tax-percent') }}</th>
<th>{{ __('admin::app.sales.orders.tax-amount') }}</th>
@if ($order->base_discount_amount > 0)
<th>{{ __('admin::app.sales.orders.discount-amount') }}</th>
@endif
<th>{{ __('admin::app.sales.orders.grand-total') }}</th>
</tr>
</thead>
@ -247,6 +250,7 @@
<td>
{{ $item->type == 'configurable' ? $item->child->sku : $item->sku }}
</td>
<td>
{{ $item->name }}
@ -254,7 +258,9 @@
<p>{{ $html }}</p>
@endif
</td>
<td>{{ core()->formatBasePrice($item->base_price) }}</td>
<td>
<span class="qty-row">
{{ $item->qty_ordered ? __('admin::app.sales.orders.item-ordered', ['qty_ordered' => $item->qty_ordered]) : '' }}
@ -272,9 +278,17 @@
{{ $item->qty_canceled ? __('admin::app.sales.orders.item-canceled', ['qty_canceled' => $item->qty_canceled]) : '' }}
</span>
</td>
<td>{{ core()->formatBasePrice($item->base_total) }}</td>
<td>{{ $item->tax_percent }}%</td>
<td>{{ core()->formatBasePrice($item->base_tax_amount) }}</td>
@if ($order->base_discount_amount > 0)
<td>{{ core()->formatBasePrice($item->base_discount_amount) }}</td>
@endif
<td>{{ core()->formatBasePrice($item->base_total + $item->base_tax_amount) }}</td>
</tr>
@endforeach
@ -294,6 +308,14 @@
<td>{{ core()->formatBasePrice($order->base_shipping_amount) }}</td>
</tr>
@if ($order->base_discount_amount > 0)
<tr>
<td>{{ __('admin::app.sales.orders.discount') }}</td>
<td>-</td>
<td>-{{ core()->formatBasePrice($order->base_discount_amount) }}</td>
</tr>
@endif
<tr class="border">
<td>{{ __('admin::app.sales.orders.tax') }}</td>
<td>-</td>

View File

@ -798,10 +798,14 @@ class Cart {
$cart->grand_total = $cart->base_grand_total = 0;
$cart->sub_total = $cart->base_sub_total = 0;
$cart->tax_total = $cart->base_tax_total = 0;
$cart->discount_amount = $cart->base_discount_amount = 0;
foreach ($cart->items()->get() as $item) {
$cart->grand_total = (float) $cart->grand_total + $item->total + $item->tax_amount;
$cart->base_grand_total = (float) $cart->base_grand_total + $item->base_total + $item->base_tax_amount;
$cart->discount_amount += $item->discount_amount;
$cart->base_discount_amount += $item->base_discount_amount;
$cart->grand_total = (float) $cart->grand_total + $item->total + $item->tax_amount - $item->discount_amount;
$cart->base_grand_total = (float) $cart->base_grand_total + $item->base_total + $item->base_tax_amount - $item->base_discount_amount;
$cart->sub_total = (float) $cart->sub_total + $item->total;
$cart->base_sub_total = (float) $cart->base_sub_total + $item->base_total;

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateZipcodeColumnTypeToVarcharInCartAddressTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cart_address', function (Blueprint $table) {
$table->string('postcode')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cart_address', function (Blueprint $table) {
//
});
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RenameDiscountColumnsInCartTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cart', function (Blueprint $table) {
$table->renameColumn('discount', 'discount_amount');
$table->renameColumn('base_discount', 'base_discount_amount');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cart', function (Blueprint $table) {
//
});
}
}

View File

@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddRemainingColumnInProductFlatTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('product_flat', function (Blueprint $table) {
$table->text('short_description')->nullable();
$table->text('meta_title')->nullable();
$table->text('meta_keywords')->nullable();
$table->text('meta_description')->nullable();
$table->decimal('width', 12, 4)->nullable();
$table->decimal('height', 12, 4)->nullable();
$table->decimal('depth', 12, 4)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('product_flat', function (Blueprint $table) {
$table->dropColumn('short_description');
$table->dropColumn('meta_title');
$table->dropColumn('meta_keywords');
$table->dropColumn('meta_description');
$table->dropColumn('width', 12, 4);
$table->dropColumn('height', 12, 4);
$table->dropColumn('depth', 12, 4);
});
}
}

View File

@ -186,7 +186,7 @@ class ProductFlat
if ($parentProduct && ! in_array($attribute->code, array_merge($superAttributes[$parentProduct->id], ['sku', 'name', 'price', 'weight', 'status'])))
continue;
if (in_array($attribute->code, ['short_description', 'tax_category_id', 'meta_title', 'meta_keywords', 'meta_description', 'width', 'height']))
if (in_array($attribute->code, ['tax_category_id']))
continue;
if (! Schema::hasColumn('product_flat', $attribute->code))

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddDiscountColumnsInInvoiceItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('invoice_items', function (Blueprint $table) {
$table->decimal('discount_percent', 12, 4)->default(0)->nullable();
$table->decimal('discount_amount', 12, 4)->default(0)->nullable();
$table->decimal('base_discount_amount', 12, 4)->default(0)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoice_items', function (Blueprint $table) {
//
});
}
}

View File

@ -121,6 +121,8 @@ class InvoiceRepository extends Repository
'base_total' => $orderItem->base_price * $qty,
'tax_amount' => ( ($orderItem->tax_amount / $orderItem->qty_ordered) * $qty ),
'base_tax_amount' => ( ($orderItem->base_tax_amount / $orderItem->qty_ordered) * $qty ),
'discount_amount' => ( ($orderItem->discount_amount / $orderItem->qty_ordered) * $qty ),
'base_discount_amount' => ( ($orderItem->base_discount_amount / $orderItem->qty_ordered) * $qty ),
'product_id' => $orderItem->product_id,
'product_type' => $orderItem->product_type,
'additional' => $orderItem->additional,
@ -142,6 +144,8 @@ class InvoiceRepository extends Repository
'base_total' => $childOrderItem->base_price * $qty,
'tax_amount' => 0,
'base_tax_amount' => 0,
'discount_amount' => 0,
'base_discount_amount' => 0,
'product_id' => $childOrderItem->product_id,
'product_type' => $childOrderItem->product_type,
'additional' => $childOrderItem->additional,
@ -177,6 +181,7 @@ class InvoiceRepository extends Repository
{
$subTotal = $baseSubTotal = 0;
$taxAmount = $baseTaxAmount = 0;
$discountAmount = $baseDiscountAmount = 0;
foreach ($invoice->items as $invoiceItem) {
$subTotal += $invoiceItem->total;
@ -184,6 +189,9 @@ class InvoiceRepository extends Repository
$taxAmount += $invoiceItem->tax_amount;
$baseTaxAmount += $invoiceItem->base_tax_amount;
$discountAmount += $invoiceItem->discount_amount;
$baseDiscountAmount += $invoiceItem->base_discount_amount;
}
$shippingAmount = $invoice->order->shipping_amount;
@ -207,8 +215,8 @@ class InvoiceRepository extends Repository
$invoice->tax_amount = $taxAmount;
$invoice->base_tax_amount = $baseTaxAmount;
$invoice->grand_total = $subTotal + $taxAmount + $shippingAmount;
$invoice->base_grand_total = $baseSubTotal + $baseTaxAmount + $baseShippingAmount;
$invoice->grand_total = $subTotal + $taxAmount + $shippingAmount - $discountAmount;
$invoice->base_grand_total = $baseSubTotal + $baseTaxAmount + $baseShippingAmount - $baseDiscountAmount;
$invoice->save();

View File

@ -262,10 +262,13 @@ class OrderRepository extends Repository
$order->tax_amount_invoiced += $invoice->tax_amount;
$order->base_tax_amount_invoiced += $invoice->base_tax_amount;
$order->discount_invoiced += $invoice->discount_amount;
$order->base_discount_invoiced += $invoice->base_discount_amount;
}
$order->grand_total_invoiced = $order->sub_total_invoiced + $order->shipping_invoiced + $order->tax_amount_invoiced;
$order->base_grand_total_invoiced = $order->base_sub_total_invoiced + $order->base_shipping_invoiced + $order->base_tax_amount_invoiced;
$order->grand_total_invoiced = $order->sub_total_invoiced + $order->shipping_invoiced + $order->tax_amount_invoiced - $order->discount_invoiced;
$order->base_grand_total_invoiced = $order->base_sub_total_invoiced + $order->base_shipping_invoiced + $order->base_tax_amount_invoiced - $order->base_discount_invoiced;
$order->save();

View File

@ -254,6 +254,7 @@ return [
'subtotal' => 'المجموع الفرعي',
'shipping-handling' => 'الشحن والمناولة',
'tax' => 'الضرائب',
'discount' => 'Discount',
'tax-percent' => 'نسبة الضرائب',
'tax-amount' => 'المبلغ الضريبي',
'discount-amount' => 'مبلغ الخصم',
@ -430,6 +431,7 @@ return [
'grand-total' => 'المجموع الكلي',
'delivery-charges' => 'رسوم التسليم',
'tax' => 'الضرائب',
'discount' => 'Discount',
'price' => 'السعر '
],
@ -458,6 +460,7 @@ return [
'subtotal' => 'المجموع الفرعي',
'shipping-handling' => 'الشحن والمناولة',
'tax' => 'الضرائب',
'discount' => 'Discount',
'grand-total' => 'المجموع الكلي',
'final-summary' => 'شكرا لإظهارك إهتمامك بمتجرنا سنرسل لك رقم التتبع بمجرد شحنه',
'help' => 'إذا كنت بحاجة إلى أي نوع من المساعدة يرجى الاتصال بنا على: support_email',

View File

@ -260,6 +260,7 @@ return [
'subtotal' => 'Subtotal',
'shipping-handling' => 'Shipping & Handling',
'tax' => 'Tax',
'discount' => 'Discount',
'tax-percent' => 'Tax Percent',
'tax-amount' => 'Tax Amount',
'discount-amount' => 'Discount Amount',
@ -441,6 +442,7 @@ return [
'grand-total' => 'Grand Total',
'delivery-charges' => 'Delivery Charges',
'tax' => 'Tax',
'discount' => 'Discount',
'price' => 'price'
],
@ -471,6 +473,7 @@ return [
'subtotal' => 'Subtotal',
'shipping-handling' => 'Shipping & Handling',
'tax' => 'Tax',
'discount' => 'Discount',
'grand-total' => 'Grand Total',
'final-summary' => 'Thanks for showing your interest in our store we will send you tracking number once it shipped',
'help' => 'If you need any kind of help please contact us at :support_email',

View File

@ -256,6 +256,7 @@ return [
'subtotal' => 'Subtotal',
'shipping-handling' => 'Entrega & Manuseio',
'tax' => 'Imposto',
'discount' => 'Discount',
'tax-percent' => 'Percentagem de imposto',
'tax-amount' => 'Valor de Imposto',
'discount-amount' => 'Valor de Desconto',
@ -438,6 +439,7 @@ return [
'grand-total' => 'Total',
'delivery-charges' => 'Taxas de Entrega',
'tax' => 'Imposto',
'discount' => 'Discount',
'price' => 'preço'
],
@ -466,6 +468,7 @@ return [
'subtotal' => 'Subtotal',
'shipping-handling' => 'Envio & Manuseio',
'tax' => 'Imposto',
'discount' => 'Discount',
'grand-total' => 'Total',
'final-summary' => 'Obrigado por mostrar o seu interesse em nossa loja nós lhe enviaremos o número de rastreamento assim que for despachado',
'help' => 'Se você precisar de algum tipo de ajuda, por favor entre em contato conosco :support_email',

View File

@ -11,6 +11,10 @@
@foreach ($shippingRateGroups as $rateGroup)
{!! view_render_event('bagisto.shop.checkout.shipping-method.before', ['rateGroup' => $rateGroup]) !!}
<span class="carrier-title" id="carrier-title" style="font-size:18px; font-weight: bold;">
{{ $rateGroup['carrier_title'] }}
</span>
@foreach ($rateGroup['rates'] as $rate)
<div class="checkout-method-group mb-20">
<div class="line-one">

View File

@ -105,7 +105,7 @@
{{ __('shop::app.mail.order.price') }}
</label>
<span style="font-size: 18px;color: #242424;margin-left: 40px;font-weight: bold;">
{{ core()->formatPrice($item->price, $order->order_currency_code) }}
{{ core()->formatBasePrice($item->base_price) }}
</span>
</div>
@ -132,28 +132,37 @@
<div>
<span>{{ __('shop::app.mail.order.subtotal') }}</span>
<span style="float: right;">
{{ core()->formatPrice($order->sub_total, $order->order_currency_code) }}
{{ core()->formatBasePrice($order->base_sub_total) }}
</span>
</div>
<div>
<span>{{ __('shop::app.mail.order.shipping-handling') }}</span>
<span style="float: right;">
{{ core()->formatPrice($order->shipping_amount, $order->order_currency_code) }}
{{ core()->formatBasePrice($order->base_shipping_amount) }}
</span>
</div>
<div>
<span>{{ __('shop::app.mail.order.tax') }}</span>
<span style="float: right;">
{{ core()->formatPrice($order->tax_amount, $order->order_currency_code) }}
{{ core()->formatBasePrice($order->base_tax_amount) }}
</span>
</div>
@if ($order->discount_amount > 0)
<div>
<span>{{ __('shop::app.mail.order.discount') }}</span>
<span style="float: right;">
{{ core()->formatBasePrice($order->base_discount_amount) }}
</span>
</div>
@endif
<div style="font-weight: bold">
<span>{{ __('shop::app.mail.order.grand-total') }}</span>
<span style="float: right;">
{{ core()->formatPrice($order->grand_total, $order->order_currency_code) }}
{{ core()->formatBasePrice($order->base_grand_total) }}
</span>
</div>
</div>

View File

@ -152,6 +152,15 @@
</span>
</div>
@if ($invoice->discount_amount > 0)
<div>
<span>{{ __('shop::app.mail.order.discount') }}</span>
<span style="float: right;">
{{ core()->formatPrice($invoice->discount_amount, $invoice->order_currency_code) }}
</span>
</div>
@endif
<div style="font-weight: bold">
<span>{{ __('shop::app.mail.order.grand-total') }}</span>
<span style="float: right;">

View File

@ -150,6 +150,15 @@
</span>
</div>
@if ($order->discount_amount > 0)
<div>
<span>{{ __('shop::app.mail.order.discount') }}</span>
<span style="float: right;">
{{ core()->formatPrice($order->discount_amount, $order->order_currency_code) }}
</span>
</div>
@endif
<div style="font-weight: bold">
<span>{{ __('shop::app.mail.order.grand-total') }}</span>
<span style="float: right;">

View File

@ -67,7 +67,11 @@
<div class="footer-bottom">
<p>
{{ core()->getConfigData('general.content.footer.footer_content') }}
@if (core()->getConfigData('general.content.footer.footer_content'))
{{ core()->getConfigData('general.content.footer.footer_content') }}
@else
{{ trans('admin::app.footer.copy-right') }}
@endif
</p>
</div>