import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';

import { SaleOrder } from "../../odoo/models/sale.order";
import { SaleOrderLine } from "../../odoo/models/sale.order.line";
import { BaseDetailsView } from "../../base/base-details-view";

@Component({
    selector: 'page-order',
    templateUrl: 'order.html'
})
export class OrderPage extends BaseDetailsView<SaleOrder> {

    constructor(
        public navCtrl: NavController,
        public navParams: NavParams
    ) { 
        super(SaleOrder, navParams.data.item, navParams.data.kind);

        let titleKind = super.getKind() === "budget" ? "Presupuesto" : "Venta";
        super.setTitle(super.itemExists() ? "Editar " + titleKind : "Crear " + titleKind);
    }

    /**
     * 
     */
    ionViewDidLoad() {
        console.log('ionViewDidLoad OrderPage');
    }
}
