Merge branch 'kzrl/64-editable-payment-terms' into 'master'
64 - editable payment terms See merge request minimalist.software/cmc-sales!4
This commit is contained in:
commit
076034f802
|
|
@ -626,6 +626,11 @@ ENDINSTRUCTIONS;
|
|||
|
||||
|
||||
$newDoc['Document']['shipping_details'] = $this->defaultShippingText;
|
||||
$newDoc['Document']['doc_page_count'] = 0;
|
||||
$newDoc['Document']['cmc_reference'] = '';
|
||||
$newDoc['Document']['pdf_filename'] = '';
|
||||
$newDoc['Document']['pdf_created_at'] = '0000-00-00 00:00:00';
|
||||
$newDoc['Document']['pdf_created_at'] = 0;
|
||||
$newDoc['OrderAcknowledgement']['fob'] = $this->defaultFOB;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ class QuotesController extends AppController {
|
|||
$this->set(compact('enquiry', 'quote', 'currencies'));
|
||||
|
||||
$this->set('cityCountryList', $this->Quote->Enquiry->Principle->getCityCountryList());
|
||||
$this->set('quoteID', $id);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -297,6 +298,15 @@ class QuotesController extends AppController {
|
|||
|
||||
}
|
||||
|
||||
// #64 - ability to customise payment terms dropdown box.
|
||||
// jquery is hopelessly out of date, so trying htmx for novelty.
|
||||
function paymentTerms($id = null) {
|
||||
$this->layout = 'ajax';
|
||||
|
||||
$quote = $this->Quote->read(null, $id);
|
||||
$this->data = $quote;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -88,6 +88,11 @@ class Job extends AppModel {
|
|||
$newJob['Job']['contact_id'] = $enquiry['Enquiry']['contact_id'];
|
||||
$newJob['Job']['enquiry_id'] = $enquiry['Enquiry']['id'];
|
||||
$newJob['Job']['date_order_received'] = date('Y-m-d');
|
||||
$newJob['Job']['all_sent'] = 0;
|
||||
$newJob['Job']['all_paid'] = 0;
|
||||
$newJob['Job']['comments'] = '';
|
||||
|
||||
|
||||
|
||||
if(!empty($customerOrderNumber)) {
|
||||
$newJob['Job']['customer_order_number'] = $customerOrderNumber;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
<?php echo $javascript->link('customer_edit'); ?>
|
||||
|
||||
|
||||
<div class="customers form">
|
||||
<?php echo $form->create('Customer');?>
|
||||
<fieldset>
|
||||
|
|
@ -6,7 +9,18 @@
|
|||
echo $form->input('id');
|
||||
echo $form->input('name');
|
||||
echo $form->input('abn');
|
||||
echo $this->element('payment_terms_box');
|
||||
//echo $this->element('payment_terms_box');
|
||||
?>
|
||||
<div class="input select"><label for="CustomerPaymentTermsOptions">Payment Terms</label><select name="data[Customer][payment_terms]" id="CustomerPaymentTermsOptions">
|
||||
<option value="">Select the Terms of Payment</option>
|
||||
<option value="100% Payment with Order">100% Payment with Order</option>
|
||||
<option value="Net 7 Days for Approved Accounts">Net 7 Days for Approved Accounts</option>
|
||||
<option value="Net 14 Days for Approved Accounts">Net 14 Days for Approved Accounts</option>
|
||||
<option value="Net 30 Days for Approved Accounts">Net 30 Days for Approved Accounts</option>
|
||||
</select></div>
|
||||
<?php
|
||||
|
||||
echo $form->input('payment_terms');
|
||||
echo $form->input('discount_pricing_policies', array('label'=>'Discount and Pricing Policies'));
|
||||
echo $form->input('notes');
|
||||
echo $form->input('url', array('label'=>'Website URL'));
|
||||
|
|
|
|||
|
|
@ -43,6 +43,12 @@
|
|||
|
||||
echo $form->input('Invoice.ship_via');
|
||||
echo $form->input('Invoice.fob');
|
||||
?>
|
||||
<div class="input">Payment terms: <?=$enquiry['Customer']['payment_terms'];?></div>
|
||||
<div class="input">
|
||||
<a href="/customers/edit/<?=$enquiry['Customer']['id'];?>">Set the payment terms for this customer</a>
|
||||
</div>
|
||||
<?php
|
||||
echo $form->input('Document.shipping_details', array('id'=>'shippingDetails'));
|
||||
echo $form->end(array('label'=>'Save Invoice Details', 'id'=>'saveInvoiceButton'));
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,12 @@
|
|||
|
||||
echo $form->input('OrderAcknowledgement.ship_via');
|
||||
echo $form->input('OrderAcknowledgement.fob');
|
||||
?>
|
||||
<div class="input">Payment terms: <?=$enquiry['Customer']['payment_terms'];?></div>
|
||||
<div class="input">
|
||||
<a href="/customers/edit/<?=$enquiry['Customer']['id'];?>">Set the payment terms for this customer</a>
|
||||
</div>
|
||||
<?php
|
||||
echo $form->input('OrderAcknowledgement.estimated_delivery');
|
||||
echo $form->input('OrderAcknowledgement.signature_required', array('options' => array('1' => 'Yes', '0' => 'No')));
|
||||
echo $form->input('Document.shipping_details', array('id'=>'shippingDetails'));
|
||||
|
|
|
|||
|
|
@ -28,6 +28,12 @@
|
|||
|
||||
|
||||
echo $form->input('PackingList.fob');
|
||||
?>
|
||||
<div class="input">Payment terms: <?=$enquiry['Customer']['payment_terms'];?></div>
|
||||
<div class="input">
|
||||
<a href="/customers/edit/<?=$enquiry['Customer']['id'];?>">Set the payment terms for this customer</a>
|
||||
</div>
|
||||
<?php
|
||||
echo $form->input('Document.shipping_details', array('id'=>'shippingDetails'));
|
||||
echo $form->end(array('label'=>'Save PackingList Details', 'id'=>'savePackingListButton'));
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
echo $form->input('payment_terms', array('empty'=>'Select the Terms of Payment', 'options' => array(
|
||||
echo $form->input('payment_terms', array('id'=>'paymentTermsOptions', 'empty'=>'Select the Terms of Payment', 'options' => array(
|
||||
'100% Payment with Order' => '100% Payment with Order',
|
||||
'Net 7 Days for Approved Accounts' => 'Net 7 Days for Approved Accounts',
|
||||
'Net 14 Days for Approved Accounts' => 'Net 14 Days for Approved Accounts',
|
||||
|
|
|
|||
|
|
@ -50,14 +50,20 @@ echo $form->input('currency_id');
|
|||
echo $form->input('revision', array('type'=>'hidden'));
|
||||
echo $form->input('delivery_time');
|
||||
echo $form->input('delivery_time_frame',array('type'=>'select', 'empty'=>'Choose Delivery Time Frame', 'options'=>array('WORKING DAYS'=>'WORKING DAYS', 'WORKING WEEKS'=>'WORKING WEEKS')));
|
||||
|
||||
echo $form->input('payment_terms', array('empty'=>'Select the Terms of Payment', 'options' => array(
|
||||
?>
|
||||
<div id="paymentTerms">
|
||||
<?php
|
||||
echo $form->input('payment_terms_options', array('empty'=>'Select the Terms of Payment', 'options' => array(
|
||||
'100% Payment with Order' => '100% Payment with Order',
|
||||
'Net 7 Days for Approved Accounts' => 'Net 7 Days for Approved Accounts',
|
||||
'Net 14 Days for Approved Accounts' => 'Net 14 Days for Approved Accounts',
|
||||
'Net 30 Days for Approved Accounts' => 'Net 30 Days for Approved Accounts',
|
||||
'SEE PAGE 1 FOR DETAILS' => 'SEE PAGE 1 FOR DETAILS'
|
||||
)));
|
||||
?>
|
||||
</div>
|
||||
<?php echo $form->input('Quote.payment_terms');
|
||||
|
||||
echo $form->input('days_valid');
|
||||
echo $form->input('date_issued_display', array('id'=>'date_issued_display', 'label'=>'Date Issued', 'value'=>$this->element('isEmptyDate', array('date'=>$this->data['Quote']['date_issued']))));
|
||||
echo $form->input('date_issued', array('type'=>'hidden', 'id'=>'date_issued'));
|
||||
|
|
|
|||
3
app/views/quotes/payment_details.ctp
Normal file
3
app/views/quotes/payment_details.ctp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<php
|
||||
echo $form->input('payment_terms');
|
||||
?>
|
||||
3
app/views/quotes/payment_terms.ctp
Normal file
3
app/views/quotes/payment_terms.ctp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
echo $form->input('Quote.payment_terms');
|
||||
?>
|
||||
|
|
@ -441,6 +441,15 @@ $(function() {
|
|||
});
|
||||
|
||||
|
||||
|
||||
// Fairly quick and easy way to make this select box editable. Good enough.
|
||||
$("#QuotePaymentTermsOptions").live('change', function(data) {
|
||||
selectedOption = $("#QuotePaymentTermsOptions").val();
|
||||
$("#QuotePaymentTerms").val(selectedOption);
|
||||
console.log(selectedOption);
|
||||
});
|
||||
|
||||
|
||||
$("#generateFirstPage").click(function() {
|
||||
|
||||
if($(".firstPage").length == 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue