Implemented ex-works Delivery point for principles. Closes #12
This commit is contained in:
parent
5c8921c818
commit
06a483338d
|
|
@ -121,6 +121,8 @@ class QuotesController extends AppController {
|
||||||
$currencies = $this->Quote->Currency->find('list');
|
$currencies = $this->Quote->Currency->find('list');
|
||||||
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
$this->set('yesNo', array(0=>'No', 1=>'Yes'));
|
||||||
$this->set(compact('enquiry', 'quote', 'currencies'));
|
$this->set(compact('enquiry', 'quote', 'currencies'));
|
||||||
|
|
||||||
|
$this->set('cityCountryList', $this->Quote->Enquiry->Principle->getCityCountryList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,28 @@ class Principle extends AppModel {
|
||||||
'foreignKey' => 'principle_id'
|
'foreignKey' => 'principle_id'
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
function getCityCountryList() {
|
||||||
|
$principles = $this->find('all', array('recursive'=>1));
|
||||||
|
|
||||||
|
|
||||||
|
$search = array('{company}','{city}','{country}');
|
||||||
|
$phrase = "Ex Works Incoterms 2010 ({company}, {city}, {country})";
|
||||||
|
|
||||||
|
$list = array();
|
||||||
|
|
||||||
|
foreach($principles as $principle) {
|
||||||
|
$replace = array($principle['Principle']['name'], $principle['Principle']['city'], $principle['Country']['name']);
|
||||||
|
|
||||||
|
$newPhrase = str_replace($search, $replace, $phrase);
|
||||||
|
|
||||||
|
$list[$newPhrase] = $newPhrase;
|
||||||
|
}
|
||||||
|
return $list;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,12 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$exworksCMC = array('Ex Works Incoterms 2010 (CMC Technologies, Alexandria, NSW Australia)' => 'Ex Works Incoterms 2010 (CMC Technologies, Alexandria, NSW Australia)');
|
||||||
|
|
||||||
|
$deliveryOptions = array_merge($exworksCMC, $cityCountryList);
|
||||||
|
|
||||||
|
|
||||||
echo $form->create('Quote',array('default'=>false));
|
echo $form->create('Quote',array('default'=>false));
|
||||||
|
|
||||||
echo $form->input('id');
|
echo $form->input('id');
|
||||||
|
|
@ -46,12 +52,12 @@ echo $form->input('date_issued_display', array('id'=>'date_issued_display', 'lab
|
||||||
echo $form->input('date_issued', array('type'=>'hidden', 'id'=>'date_issued'));
|
echo $form->input('date_issued', array('type'=>'hidden', 'id'=>'date_issued'));
|
||||||
echo $form->input('valid_until_display', array('id'=>'valid_until_display', 'label'=>'Valid Until', 'value'=>$this->element('isEmptyDate', array('date'=>$this->data['Quote']['valid_until']))));
|
echo $form->input('valid_until_display', array('id'=>'valid_until_display', 'label'=>'Valid Until', 'value'=>$this->element('isEmptyDate', array('date'=>$this->data['Quote']['valid_until']))));
|
||||||
echo $form->input('valid_until', array('type'=>'hidden', 'id'=>'valid_until'));
|
echo $form->input('valid_until', array('type'=>'hidden', 'id'=>'valid_until'));
|
||||||
echo $form->input('delivery_point', array('type'=>'select', 'options'=>array(
|
echo $form->input('delivery_point', array('type'=>'select', 'options'=>$deliveryOptions));
|
||||||
'Ex Works Incoterms 2010 (CMC Technologies, Alexandria, NSW Australia)' => 'Ex Works Incoterms 2010 (CMC Technologies, Alexandria, NSW Australia)'
|
|
||||||
)));
|
|
||||||
echo $form->input('exchange_rate', array('default'=>'NOT APPLICABLE, FIXED PRICE QUOTED'));
|
echo $form->input('exchange_rate', array('default'=>'NOT APPLICABLE, FIXED PRICE QUOTED'));
|
||||||
echo $form->input('customs_duty');
|
echo $form->input('customs_duty');
|
||||||
echo $form->input('document_id',array('type'=>'hidden'));
|
echo $form->input('document_id',array('type'=>'hidden'));
|
||||||
echo $form->input('commercial_comments', array('between'=>'<button class="generateCommercialComments">(re)Generate Commercial Comments</button>'));
|
echo $form->input('commercial_comments', array('between'=>'<button class="generateCommercialComments">(re)Generate Commercial Comments</button>'));
|
||||||
echo $form->end();
|
echo $form->end();
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in a new issue