Exemplo n.º 1
0
 public function run()
 {
     $faker = Faker::create();
     $count = 100;
     $region_ids = Region::lists('region_id');
     foreach (range(1, $count) as $i) {
         Quotation::create(['A76_80' => $faker->randomFloat(6, $min = 19, $max = 24), 'A92' => $faker->randomFloat(6, $min = 19, $max = 24), 'A95' => $faker->randomFloat(6, $min = 19, $max = 24), 'region_id' => $faker->randomElement($region_ids), 'added_on' => Carbon::instance($faker->dateTimeBetween('10.07.2015', '16.07.2015'))->toDateString()]);
     }
 }
Exemplo n.º 2
0
 public function testDiscardQuotation()
 {
     sleep(1);
     $client = Client::GetClient(2);
     //Creation
     $quotation = Quotation::CreateQuotation($client);
     $service = SurveyOfficeService::Create('Engineering Survey', 'Survey of the engineering kind', floatval(17500));
     $ql = QuotationLine::Create($quotation->id, $service->name, 'Task Description', 2, $service->rate, 16);
     $quotation->addToQuote($ql);
     $this->assertInstanceOf('Quotation', $quotation);
     //discarding
     $quotation->discard();
     //should fail
     $quotation = Quotation::GetQuotation($quotation->id);
     $this->assertTrue($quotation == null);
     //discarding
     //Quotation::Delete($quotation->id);
 }
Exemplo n.º 3
0
 /**
  * [__construct description]
  * @param [Array] $multirequest    indexed array containing quotation information, namely "from", "to", "parcels" and "additional_params"
  */
 public function __construct($multirequest)
 {
     parent::__construct();
     foreach ($multirequest as $quot_index => $quot_info) {
         // set additional params
         $params = $quot_info['additional_params'];
         // Set sender
         foreach ($quot_info['from'] as $key => $value) {
             $params['expediteur.' . $key] = $value;
         }
         // Set recipient
         foreach ($quot_info['to'] as $key => $value) {
             $params['destinataire.' . $key] = $value;
         }
         // Set parcel
         foreach ($quot_info['parcels']['dimensions'] as $d => $data) {
             $params[$quot_info['parcels']['type'] . '_' . $d . '.poids'] = $data['poids'];
             $params[$quot_info['parcels']['type'] . '_' . $d . '.longueur'] = $data['longueur'];
             $params[$quot_info['parcels']['type'] . '_' . $d . '.largeur'] = $data['largeur'];
             $params[$quot_info['parcels']['type'] . '_' . $d . '.hauteur'] = $data['hauteur'];
         }
         $this->setParamMulti($params);
     }
 }
Exemplo n.º 4
0
 public function reviseQuotation($qid, $data)
 {
     $db = Database::getInstance();
     $conn = $db->getConnection();
     $conn->beginTransaction();
     try {
         $stmt1 = $conn->prepare("DELETE FROM quotation_tax_applicable_to  WHERE TaxID IN (SELECT TaxID FROM quotation_tax_details  WHERE QuotationId = :qid)");
         $stmt1->bindParam(':qid', $qid, PDO::PARAM_STR);
         if ($stmt1->execute() === TRUE) {
             $stmt2 = $conn->prepare("DELETE FROM quotation_tax_details  WHERE QuotationId = :qid");
             $stmt2->bindParam(':qid', $qid, PDO::PARAM_STR);
             if ($stmt2->execute() === TRUE) {
                 $stmt3 = $conn->prepare("DELETE FROM quotation_details  WHERE QuotationId = :qid");
                 $stmt3->bindParam(':qid', $qid, PDO::PARAM_STR);
                 if ($stmt3->execute() === TRUE) {
                     if (Quotation::isRefNoPresentInAnotherQuotation($data->Quotation->RefNo, $qid)) {
                         $conn->rollback();
                         return 2;
                     }
                     if (Quotation::isQuotationTitlePresentInAnotherQuotation($data->Quotation->ProjectId, $data->Quotation->QuotationTitle, $qid)) {
                         $conn->rollback();
                         return 3;
                     }
                     $result = Quotation::modifyQuotation($data, $qid);
                     if ($result) {
                         $conn->commit();
                         return 1;
                     }
                 }
             }
         }
     } catch (Exception $exception) {
         $conn->rollBack();
         throw $exception;
     }
     $conn->rollback;
     return 0;
 }
Exemplo n.º 5
0
 public function salesorders()
 {
     //FIELDS TO INCLUDE IN VIEW : SO Number || CLIENT || BILLING STATUS || DELIVERY STATUS || TOTAL AMOUNT || REMAINING BLANACE
     return View::make('sales.quotations.salesorders')->withQuotations(Quotation::where('billing_status', 'SalesOrder')->orWhere('billing_status', 'Downpayment')->orWhere('billing_status', 'FullPayment')->paginate(15));
 }
Exemplo n.º 6
0
<?php

require_once "../../../lib/quotation.class.php";
require_once "../../../lib/helper_functions.php";
$quotation = new Quotation();
$quotations = $quotation->findQuotaionList();
//var_dump($quotations);
?>
	 <div id="inline_form">
			
			<div class="mediumbody">
				<div class="lowbanner1"> </div>
	            <div class="lowbannertest">	
					<ul>
						<li style="width:420px">Items </li>
						<li style="width:130px">Indent Code</li>  
						<li style="width:70px">Supplier</li> 
						<li style="width:50px">Details</li>						
					</ul>
				</div>
	            <div class="lowbanner3"> </div>	
		</div> 

	
	<?php 
if (!empty($quotations)) {
    ?>

		<?php 
    foreach ($quotations as $quo) {
        ?>
Exemplo n.º 7
0
<?php

include "system.php";
include 'class/Quotation.inc.php';
if ($havewriteperm == 1) {
    $permctrl = $readwritepermctrl;
} else {
    $permctrl = $readonlypermctrl;
}
$action = $_REQUEST['action'];
$o = new Quotation();
$o->issotrx = 1;
$o->quotationfilename = "salesquotation.php";
$o->spquotation_prefix = $prefix_spi;
//$o->documenttype='I';//1=quotation, 2=cashbill saverecord
$o->updated = date("Y-m-d H:i:s", time());
$o->updatedby = $xoopsUser->getVar("uid");
switch ($action) {
    case "html":
        $o->showHtmlTable($_POST["quotation_id"]);
        break;
    case "checkaddresstext":
        include "../bpartner/class/Address.inc.php";
        $add = new Address();
        $addtxt = $add->getAddressTxt($_REQUEST['address_id']);
        echo $addtxt;
        break;
    case "create":
        if ($havewriteperm == 0) {
            redirect_header("{$o->quotationfilename}", $pausetime + 3, "Sorry, you don't have write permission.");
        }
 public function actionFindQuotationById($id)
 {
     $quotation = Quotation::model()->findByPk((int) $id);
     echo CJSON::encode($quotation);
 }
Exemplo n.º 9
0


<br><br><br>

<div class="CSSTableGenerator" ><table border="0" >
<?php 
$collection = new Quotation();
if ($login->admin_role == "SM") {
    $collection = array();
} else {
    echo "<h3>Other Requests</h3>";
    $collection = $collection->getCollection();
}
if (isset($_GET['requests'])) {
    $request = new Quotation($_GET['requests']);
    if (isset($_GET['approve'])) {
        $request->approve();
        header('location:index.php?requests');
    } elseif (isset($_GET['cancel'])) {
        $request->cancel();
        header('location:index.php?requests');
    } elseif (isset($_GET['reconsider'])) {
        $request->reconsider();
        header('location:index.php?requests');
    } elseif (isset($_GET['request_approval'])) {
        $request->requestApproval();
        header('location:index.php?requests');
    }
}
?>
 public function actionCompleteRegistrationAjax()
 {
     $client = new Client();
     $client->attributes = $_POST['Client'];
     if ($client->save()) {
         $quotation = new Quotation();
         $quotation->attributes = $_POST['Quotation'];
         $quotation->client_id = $client->primaryKey;
         $quotation->creation_date = date("Y-m-d H:i:s");
         if ($quotation->save()) {
             $quot = Quotation::model()->findByPk($quotation->primaryKey);
             $message = new YiiMailMessage();
             $message->view = 'cotizador';
             $message->setBody(array("client" => $client, "quotation" => $quot), 'text/html');
             $message->setSubject('Prospecto para Cotización');
             foreach ($quot->concessioner->emails as $email) {
                 if ($email->type == "QUOTATION") {
                     $message->addTo($email->description);
                 }
             }
             // $message->addTo("*****@*****.**");
             //$message->addTo("*****@*****.**");
             //$message->addTo("*****@*****.**");
             $message->addTo("*****@*****.**");
             $message->addTo("*****@*****.**");
             $message->setFrom(array(Yii::app()->params['adminEmail'] => 'El Equipo Nissan Ecuador'));
             Yii::app()->mail->send($message);
             echo json_encode(true);
         } else {
             echo json_encode(false);
         }
     }
     // $vehicle_version=  VehicleVersion::model()->findAllByAttributes(array("vehicle_id"=>$_POST['vehicle_id'],"status"=>"ACTIVE"));
     echo json_encode(true);
 }
Exemplo n.º 11
0
 public function getQuote($qid)
 {
     if ($this->validateAdmin()) {
         echo json_encode(Quotation::GetQuotation($qid));
     } else {
         echo 0;
     }
 }
Exemplo n.º 12
0
<?php

require_once "../../lib/quotation.class.php";
$objQuotationInfo = new Quotation();
extract($_POST);
$getData = "'','{$indentNo}','{$selSupplier}'";
extract($objQuotationInfo->CreateQuotationMaster($getData));
$getData = '';
$counter = $id;
for ($i = 0; $i < count($item_code); $i++) {
    $getData = "'null',\t'{$counter}',\n\t\t\t\t\t\t\t\t'{$item_code[$i]}',\n\t\t\t\t\t\t\t\t'{$qty[$i]}',\n\t\t\t\t\t\t\t\t'{$origin[$i]}',\n\t\t\t\t\t\t\t\t'{$band[$i]}',\n\t\t\t\t\t\t\t\t'{$deliverytime[$i]}',\n\t\t\t\t\t\t\t\t'{$price[$i]}',\n\t\t\t\t\t\t\t\t'{$warranty[$i]}'";
    $objQuotationInfo->CreateQuotationDetails($getData);
}
echo "Quotation Save successfully";
?>
	
Exemplo n.º 13
0
 public function run($args)
 {
     $daynow = date("d");
     $monthnow = date("m");
     $datenow = date("Y-m-d");
     $datenow1 = new DateTime($datenow);
     //die($datenow);
     $quotations = Quotation::model()->findAllByAttributes(array('review' => 'NO'));
     foreach ($quotations as $quotation) {
         // $datequotation=date("Y-m-d",$quotation->registration_date);
         $datequotation1 = new DateTime($quotation->creation_date);
         $aux = date_diff($datenow1, $datequotation1);
         //die(print_r($datequotation1));
         //die(print_r($aux->days));
         if ($aux->days == 2) {
             $message = new YiiMailMessage();
             $message->view = '48hours';
             $message->setBody(array("quotation" => $quotation), 'text/html');
             $message->setSubject('¿Le ofrecieron la información requerida del vehículo Nissan cotizado?. Trabajamos para ofrecerle un mejor servicio.');
             $message->addTo($quotation->client->email);
             $message->from = Yii::app()->params['adminEmail'];
             if (Yii::app()->mail->send($message)) {
                 $quotation->review = "YES";
                 $quotation->save();
             }
         }
     }
     $suggestions = Suggestion::model()->findAllByAttributes(array('review' => 'NO'));
     foreach ($suggestions as $suggestion) {
         // $datequotation=date("Y-m-d",$quotation->registration_date);
         $datequotation1 = new DateTime($suggestion->creation_date);
         $aux = date_diff($datenow1, $datequotation1);
         //die(print_r($datequotation1));
         //die(print_r($aux->days));
         if ($aux->days == 2) {
             $message = new YiiMailMessage();
             $message->view = '48hours_sugerencia';
             $message->setBody(array("suggestion" => $suggestion), 'text/html');
             $message->setSubject('¿Le ofrecieron la información requerida de la sugerencia solicitada.?. Trabajamos para ofrecerle un mejor servicio.');
             $message->addTo($suggestion->client->email);
             $message->from = Yii::app()->params['adminEmail'];
             if (Yii::app()->mail->send($message)) {
                 $suggestion->review = "YES";
                 $suggestion->save();
             }
         }
     }
     $replacements = Replacement::model()->findAllByAttributes(array('review' => 'NO'));
     foreach ($replacements as $replacement) {
         // $datequotation=date("Y-m-d",$quotation->registration_date);
         $datequotation1 = new DateTime($replacement->creation_date);
         $aux = date_diff($datenow1, $datequotation1);
         //die(print_r($datequotation1));
         //die(print_r($aux->days));
         if ($aux->days == 2) {
             $message = new YiiMailMessage();
             $message->view = '48hours_repuesto';
             $message->setBody(array("replacement" => $replacement), 'text/html');
             $message->setSubject('¿Le ofrecieron la información requerida del repuesto Nissan solicitado?. Trabajamos para ofrecerle un mejor servicio.');
             $message->addTo($replacement->client->email);
             $message->from = Yii::app()->params['adminEmail'];
             if (Yii::app()->mail->send($message)) {
                 $replacement->review = "YES";
                 $replacement->save();
             }
         }
     }
     $technicals = TechnicalDate::model()->findAllByAttributes(array('review' => 'NO'));
     foreach ($technicals as $technical) {
         // $datequotation=date("Y-m-d",$quotation->registration_date);
         $datequotation1 = new DateTime($technical->creation_date);
         $aux = date_diff($datenow1, $datequotation1);
         //die(print_r($datequotation1));
         //die(print_r($aux->days));
         if ($aux->days == 2) {
             $message = new YiiMailMessage();
             $message->view = '48hours_agendamiento';
             $message->setBody(array("technical" => $technical), 'text/html');
             $message->setSubject('Nos interesa servirle mejor.');
             $message->addTo($technical->client->email);
             $message->from = Yii::app()->params['adminEmail'];
             if (Yii::app()->mail->send($message)) {
                 $technical->review = "YES";
                 $technical->save();
             }
         }
     }
 }
Exemplo n.º 14
0
 public static function RaiseQuotationInvoice($clientId, $scope, $quotes, $discount)
 {
     $client = Client::GetClient($clientId);
     if ($scope == "G") {
         $descr = "General Services";
         $pid = 0;
     } else {
         $prj = Project::GetProject(intval($scope));
         $descr = $prj->name . ' Project';
         $pid = intval($scope);
     }
     $qids = implode(",", $quotes);
     $invoice = Invoice::CreateInvoice($client, $pid, $qids, $descr, $discount);
     foreach ($quotes as $qid) {
         $quotation = Quotation::GetQuotation($qid);
         foreach ($quotation->lineItems as $item) {
             $invoice->addToInvoice(InvoiceLine::Create($invoice->id, $item->itemName, $item->itemDesc, $item->quantity, $item->unitPrice, $item->tax));
         }
     }
     if ($invoice->generate()) {
         return new InvoiceTX($invoice, 'Quotation Invoice');
     } else {
         Logger::Log('InvoiceTX', 'Failed', 'Quotation invoice transaction with id:' . $invoice->id . ' and tx id:' . $this->transactionId . ' could not be completed');
         return false;
     }
 }
Exemplo n.º 15
0
 public function deleteQuotation($id)
 {
     $quotation = Quotation::deleteQuotation($id);
     return $quotation;
 }
Exemplo n.º 16
0
 public static function init()
 {
     self::$content = file_get_contents(self::$apiUrl);
     self::$content = json_decode(self::$content);
 }
Exemplo n.º 17
0
 public function actionSendFromQuotationBillToBillSale()
 {
     $this->checkLogin();
     $quotation_id = (int) $_POST['quotation_id'];
     $vat_price = $_POST['vat_price'];
     $quotation = Quotation::model()->findByPk((int) $quotation_id);
     if (!empty($quotation)) {
         $billSale = BillSale::model()->findByAttributes(array('quotation_id' => $quotation_id));
         if (empty($billSale)) {
             $user_id = Yii::app()->request->cookies['user_id']->value;
             $user = User::model()->findByPk($user_id);
             //
             // create bill_sale
             //
             $billSale = new BillSale();
             $billSale->quotation_id = $quotation_id;
             $billSale->sale_type = 'sale';
             $billSale->bill_sale_pay_date = new CDbExpression('NOW()');
             $billSale->branch_id = $user->branch_id;
             $billSale->user_id = $user_id;
             $billSale->member_id = 0;
             $billSale->bill_sale_status = 'pay';
             $billSale->bill_sale_created_date = new CDbExpression('NOW()');
             if ($quotation->vat > 0) {
                 $vat_price = str_replace(',', '', $vat_price);
                 $billSale->vat_type = 'out';
                 $billSale->out_vat = $vat_price;
                 $billSale->bill_sale_vat = 'vat';
                 $billSale->vat_percen = $quotation->vat;
             }
             if ($billSale->save()) {
                 //
                 // read from quotation and transfer to tb_bill_sale_detail
                 //
                 $quotationDetails = QuotationDetail::model()->findAllByAttributes(array('quotation_id' => $quotation_id));
                 foreach ($quotationDetails as $quotationDetail) {
                     $billSaleDetail = new BillSaleDetail();
                     $billSaleDetail->bill_id = $billSale->bill_sale_id;
                     $billSaleDetail->bill_sale_detail_barcode = $quotationDetail->barcode;
                     $billSaleDetail->bill_sale_detail_price = $quotationDetail->old_price;
                     $billSaleDetail->bill_sale_detail_qty = $quotationDetail->qty;
                     $billSaleDetail->sub = $quotationDetail->sub;
                     $billSaleDetail->quotation_detail_id = $quotationDetail->id;
                     $billSaleDetail->save();
                 }
                 echo $billSale->bill_sale_id;
             }
         } else {
             echo $billSale->bill_sale_id;
         }
     }
 }
 public function po_details()
 {
     $data = Input::all();
     $json['po_number'] = $data['po_number'];
     $record = Quotation::find($data['po_number']);
     $json['record'] = $record;
     //return View::make('productions.po_details');
     return json_encode($json);
 }
Exemplo n.º 19
0
<?php

if (isset($_GET['clean'])) {
    unset($_SESSION['pending_cart']);
}
if (isset($_GET['submit']) && isset($_GET['discount'])) {
    $quotation = new Quotation();
    $discount = intval(isset($_GET['discount'])) < 100 ? intval(isset($_GET['discount'])) : 100;
    $quotation->generateQuotation($discount);
    header('location:index.php?qsuccess');
}
?>
<style>
@media screen and (max-width:720px){	
.Account-btn{
	position:absolute !important;top:0px !important;right:0px;margin-top:15px !important;
}
#login_box{
	display:block;
}
#registration_box{
	display:block;
}

}

#cart_tbl td{padding:5px; font-size:17px}

#account_section{
	overflow:hidden;
	height:0px;
Exemplo n.º 20
0
 public function saveQuotation()
 {
     $adminId = Session::get('admin_id');
     if (!isset($adminId)) {
         return json_encode(array('message' => 'not logged'));
     }
     $requestId = Session::get('current_request_id');
     if (!isset($requestId)) {
         return json_encode(array('message' => 'not logged'));
     }
     $patientRequest = PatientRequest::find($requestId);
     if (isset($patientRequest)) {
         $quotation = new Quotation();
         $quotation->request_id = $requestId;
         $quotation->kind_attention = Input::get('kind_attention');
         $quotation->dated = Input::get('dated');
         $quotation->file_number = Input::get('file_number');
         $quotation->hospital_reference = Input::get('hospital_reference');
         $quotation->patient_age = Input::get('patient_age');
         $quotation->sex = Input::get('sex');
         $quotation->nationality = Input::get('nationality');
         $quotation->medical_speciality = Input::get('medical_speciality');
         $quotation->referring_party = Input::get('referring_party');
         $quotation->treating_doctor = Input::get('treating_doctor');
         $quotation->clinical_summary = Input::get('clinical_summary');
         $quotation->clinical_success_rate = Input::get('clinical_success_rate');
         $quotation->length_of_stay = Input::get('length_of_stay');
         $quotation->pre_evaluation_prescribed = Input::get('pre_evaluation_prescribed');
         $quotation->pre_evaluation_cost = Input::get('pre_evaluation_cost');
         $quotation->pre_evolution_duration = Input::get('pre_evolution_duration');
         $quotation->surgery1_prescribed = Input::get('surgery1_prescribed');
         $quotation->surgery1_cost = Input::get('surgery1_cost');
         $quotation->surgery1_duration = Input::get('surgery1_duration');
         $quotation->surgery2_prescribed = Input::get('surgery2_prescribed');
         $quotation->surgery2_cost = Input::get('surgery2_cost');
         $quotation->surgery2_duration = Input::get('surgery2_duration');
         $quotation->followup_post_discharge_prescribed = Input::get('followup_post_discharge_prescribed');
         $quotation->followup_post_discharge_cost = Input::get('followup_post_discharge_cost');
         $quotation->followup_post_discharge_duration = Input::get('followup_post_discharge_duration');
         $quotation->total_prescribed = Input::get('total_prescribed');
         $quotation->total_cost = Input::get('total_cost');
         $quotation->total_duration = Input::get('total_duration');
         $quotation->status = "active";
         $quotation->created_at = date("Y-m-d h:i:s");
         $quotation->created_at = date("Y-m-d h:i:s");
         $quotation->save();
         $patientRequest->status = 'complete';
         $patientRequest->updated_at = date('Y-m-d h:i:s');
         $patientRequest->save();
         return json_encode(array('message' => 'done'));
     } else {
         return json_encode(array('message' => 'invalid'));
     }
 }
 public function get_view()
 {
     $quotes = Quotation::order_by('id', 'asc')->get();
     return View::Make('user.quotations.view')->with('quotes', $quotes);
 }
Exemplo n.º 22
0
 public function _getQuotationTableList()
 {
     $countrow = Quotation::get()->count();
     $quotations = Quotation::orderBy('id', 'DESC')->paginate($countrow);
     return Datatables::of($quotations)->make();
 }
Exemplo n.º 23
0
    public static function AllClientQuotations()
    {
        $collection = Quotation::GetAllQuotations($_GET['period'], $_GET['all']);
        echo '
				<div class="logo">
				  <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5>
				  <h4>ALL QUOTATIONS</h4>';
        if ($_GET['period'] != '' && $_GET['period']) {
            echo '<h5 style="margin-top:-10px">Period: ' . $_GET['period'] . '</h5>';
        }
        echo '</div>

				<table class="table table-bordered table-striped" style="text-align:center;margin-left:0;margin-right:0;width:760px;font-size:12px;">
			      <thead class="title">
			        <tr>
			          <td>DATE</td>
			          <td>QUOTE ID</td>
			          <td>CLIENT NAME</td>
			          <td>PURPOSE</td>
			          <td>INVOICED</td>
					  <td>TOTAL</td>
			        </tr>
			      </thead>
			      <tbody>';
        $total = 0.0;
        $invoiced = 0.0;
        $itms = 0;
        foreach ($collection as $item) {
            echo '<tr>
			      <td>' . $item->date . '</td>
			      <td>' . $item->id . '</td>
			      <td>' . $item->client->name . '</td>';
            if ($item->projectId != null && $item->projectId != "" && $item->projectId != 0) {
                $project = Project::GetProject($item->projectId);
                echo '<td>' . $project->name . '</td>';
            } else {
                echo '<td></td>';
            }
            if ($item->status == 1) {
                echo '<td style="color:#232836">CREATED</td>';
            } else {
                echo '<td style="color:#27c97b">INVOICED</td>';
                $invoiced += $item->total;
            }
            echo '<td class="text-right" style="padding: 0 5px;"><script>document.writeln((' . $item->total . ').formatMoney(2, \'.\', \',\'));</script></td>
			    </tr>';
            $total += $item->total;
            ++$itms;
        }
        echo '</tbody>
			    </table>
			    <div class="logo">
			    	<p style="margin: 5px 0 0 5px">Total Quotes: <b>' . $itms . '</b></p>
					<p style="margin: 5px 0 0 5px">Total Quoted: <b>Ksh. <script>document.writeln((' . $total . ').formatMoney(2, \'.\', \',\'));</script></b></p>
					<p style="margin: 5px 0 0 5px">Total Invoiced: <b>Ksh. <script>document.writeln((' . $invoiced . ').formatMoney(2, \'.\', \',\'));</script></b></p>
				</div>';
    }
Exemplo n.º 24
0
function isDirectAward($rfq)
{
    $quotation = Quotation::whereRfqId($rfq)->first();
    return $quotation->direct_award && Auth::user()->id == $quotation->secretary_id;
}
Exemplo n.º 25
0
 private static function initialize($args)
 {
     $client = Client::GetClient($args['client_id']);
     $project = new Project($args['id'], $args['name'], $args['location'], $args['descr'], $args['date'], $client, $args['stamp'], $args['status'], $args['balance']);
     $project->quotations = Quotation::GetProjectQuotations($args['id'], $client);
     $project->activities = ProjectActivity::GetActivities($args['id']);
     return $project;
 }
 private function saveQuote(Customer $customer)
 {
     // Create new or update existing
     if (\Laravel\Session::get('quote_id')) {
         $quote = Quotation::find(\Laravel\Session::get('quote_id'));
     } else {
         $quote = new Quotation();
         $quote->quick_access_code = md5(md5($customer->id) . time() . md5($quote->id));
     }
     $quote->customer_id = $customer->id;
     $quote->quotation_layouts_id = \Laravel\Session::get('quote_layout_id');
     $quote->postcode = \Laravel\Session::get('quote_postcode');
     $quote->price = Quotation::calcSessionQuotationCurrentValue();
     $quote->quote_customise_swap_window = \Laravel\Session::get('quote_customise_swap_window');
     $quote->quote_customise_swap_wall = \Laravel\Session::get('quote_customise_swap_wall');
     $quote->quote_customise_extra_door = \Laravel\Session::get('quote_customise_extra_door');
     $quote->quote_customise_fanlight = \Laravel\Session::get('quote_customise_fanlight');
     $quote->quote_customise_half_window = \Laravel\Session::get('quote_customise_half_window');
     $quote->quote_customise_picture_window = \Laravel\Session::get('quote_customise_picture_window');
     $quote->quote_decking_composite_deck_910_910 = \Laravel\Session::get('quote_decking_composite_deck_910_910');
     $quote->quote_decking_composite_deck_910_1820 = \Laravel\Session::get('quote_decking_composite_deck_910_1820');
     $quote->quote_decking_composite_deck_910_2730 = \Laravel\Session::get('quote_decking_composite_deck_910_2730');
     $quote->quote_decking_flyover_roof_910_910 = \Laravel\Session::get('quote_decking_flyover_roof_910_910');
     $quote->quote_decking_flyover_roof_910_1820 = \Laravel\Session::get('quote_decking_flyover_roof_910_1820');
     $quote->quote_decking_flyover_roof_910_2730 = \Laravel\Session::get('quote_decking_flyover_roof_910_2730');
     $quote->quote_electrics_double_sockets_450 = \Laravel\Session::get('quote_electrics_double_sockets_450');
     $quote->quote_electrics_double_sockets_1150 = \Laravel\Session::get('quote_electrics_double_sockets_1150');
     $quote->quote_electrics_light_switch = \Laravel\Session::get('quote_electrics_light_switch');
     $quote->quote_electrics_panel_heater = \Laravel\Session::get('quote_electrics_panel_heater');
     $quote->quote_electrics_double_floor_socket = \Laravel\Session::get('quote_electrics_double_floor_socket');
     $quote->quote_electrics_fused_spur_socket = \Laravel\Session::get('quote_electrics_fused_spur_socket');
     $quote->quote_internals_silver_aluminium_venitian_blind_no_screws = \Laravel\Session::get('quote_internals_silver_aluminium_venitian_blind_no_screws');
     $quote->quote_internals_recessed_blinds = \Laravel\Session::get('quote_internals_recessed_blinds');
     $quote->quote_internals_internal_910_partition_wall = \Laravel\Session::get('quote_internals_internal_910_partition_wall');
     $quote->quote_internals_internal_door_dividing_studio = \Laravel\Session::get('quote_internals_internal_door_dividing_studio');
     $quote->quote_internals_internal_wall_corner_post = \Laravel\Session::get('quote_internals_internal_wall_corner_post');
     $quote->quote_other_decoupled_floor = \Laravel\Session::get('quote_other_decoupled_floor');
     $quote->quote_other_aquastep_oak_floor = \Laravel\Session::get('quote_other_aquastep_oak_floor');
     $quote->quote_other_walls_to_timber = \Laravel\Session::get('quote_other_walls_to_timber');
     $quote->quote_other_taller_walls = \Laravel\Session::get('quote_other_taller_walls');
     $quote->quote_other_entry_steps = \Laravel\Session::get('quote_other_entry_steps');
     $quote->quote_other_entry_handrail = \Laravel\Session::get('quote_other_entry_handrail');
     $quote->quote_other_skirt = \Laravel\Session::get('quote_other_skirt');
     $quote->save();
     return $quote;
 }
Exemplo n.º 27
0
<?php

require_once "../../../lib/quotation.class.php";
require_once "../../../lib/helper_functions.php";
$quotation = new Quotation();
$quotations = $quotation->FindDetailsOfQoutation((int) $_GET[id]);
?>
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><a class="button" href="includes/contents/voucher_print/print_quotation.php?p_m_id=<?php 
echo $purchase_m_id;
?>
"  title="Purchase List">Print</a></td>
  </tr>
</table>

	 <div id="inline_form">
			
			<div class="mediumbody">
				<div class="lowbanner1"> </div>
	            <div class="lowbannertest">	
					<ul>
						<li style="width:200px">Items </li>
						<li style="width:90px">Origin</li>  
						<li style="width:70px">Delivery</li> 
						<li style="width:70px">Req Qty.</li> 
						<li style="width:60px">Price</li> 
						<li style="width:50px">Warrenty</li> 
					</ul>
				</div>
	            <div class="lowbanner3"> </div>