Commit 77448299 by Angel MAS

Field facturacion changed

parent e3f6d969
......@@ -227,7 +227,12 @@ public function shipping()
if (!\Session::has('sale')) {
$sale = $client->sales()->save(new Sale(['home_delivery'=>$request->home_delivery,'status' => 1, 'total'=>($this->total() + $costoEnvio)]));
$sale = $client->sales()->save(new Sale(
['home_delivery'=>$request->home_delivery,
'status' => 1,
'total'=>($this->total() + $costoEnvio),
'facturacion' => $request->facturacion
]));
foreach ($cart as $product) {
$item = Item::create([
......@@ -241,6 +246,7 @@ public function shipping()
} else {
$sale = Sale::find(\Session::get('sale')->id);
$sale->total = ($this->total() + $costoEnvio);
$sale->facturacion = $request->facturacion;
$sale->save();
}
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableShippingAddres extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('shipping_addres', function (Blueprint $table) {
$table->dropColumn('facturacion');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('shipping_addres', function (Blueprint $table) {
$table->string('facturacion')->nullable();
});
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableSaleShopsAddField extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('sale_shops', function (Blueprint $table) {
$table->string('facturacion')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('sale_shops', function (Blueprint $table) {
$table->dropColumn('facturacion');
});
}
}
......@@ -15,6 +15,7 @@ class SaleShop extends Model
'payment_type',
'shipping_status',
'coupon',
'facturacion',
'home_delivery'
];
......
......@@ -16,7 +16,6 @@ class ShippingAddres extends Model
'estado',
'referencias',
'client_id',
'facturacion',
'shipping_price_id'
];
......
......@@ -208,6 +208,9 @@ setlocale(LC_MONETARY, 'en_US');
</div>
<div class="col-md-6">
<p>
¿Requiere factura? <b>{{$sale->facturacion}}</b>
</p>
@if($sale->billing()->count() > 0)
<h4>Datos de facturación</h4>
Dirección: <br>
......
......@@ -41,6 +41,11 @@ Datos del comprador:
@component('mail::panel')
Facturación
- Requiere factura: *** {{$order->facturacion}} ***
@if($order->facturacion == 'Si')
[Rellenar formulario de facturación]({{route('cart.facturacion', \Crypt::encryptString($order->id))}})
@endif
@if($shipping != null)
Datos de envio:
......@@ -48,11 +53,6 @@ Datos de envio:
- Calle: *** {{$shipping->calle}} Nro. {{$shipping->numero}}, col. {{$shipping->colonia}} ***
- *** {{$shipping->ciudad}}, {{$shipping->estado}}, C.P. {{$shipping->cp}}***
- Referencias: *** {{$shipping->referencias}} ***
- Requiere factura: *** {{$shipping->facturacion}} ***
@if($shipping->facturacion == 'Si')
[Rellenar formulario de facturación]({{route('cart.facturacion', \Crypt::encryptString($order->id))}})
@endif
@else
Envio:
......
......@@ -21,4 +21,9 @@
<div class="form-group">
{!! Form::label('home_delivery', '¿Requieres envio a domicilio?', ['class'=>'']) !!}
{!! Form::select('home_delivery',[false=>'No, pasare por el paquete a la tienda', true=>'SI'], null, ['class'=>'form-control', 'required'=>'required', 'id'=>'home_delivery']) !!}
</div>
<div class="form-group">
{!! Form::label('facturacion', '¿Necesitaras factura?', ['class'=>'']) !!}
{!! Form::select('facturacion',['No'=>'No', 'Si'=>'Si'], null, ['class'=>'form-control']) !!}
</div>
\ No newline at end of file
......@@ -34,11 +34,6 @@
</div>
<div class="form-group">
{!! Form::label('facturacion', '¿Necesitaras factura?', ['class'=>'']) !!}
{!! Form::select('facturacion',['No'=>'No', 'Si'=>'Si'], isset($address) ? $addres->facturacion : null, ['class'=>'form-control']) !!}
</div>
<div class="form-group">
{!! Form::label('shipping_price_id', 'Tipo de envio', ['class'=>'']) !!}
{!! Form::select('shipping_price_id', $shipping, isset($address) && $addres->shipping_price_id != null ? $addres->shipping_price_id : null,['class'=>'form-control']) !!}
</div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment