mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-23 08:48:08 -05:00
Fix Quote, Invoice and Work Order comments (#1819)
This commit is contained in:
@@ -851,6 +851,7 @@ class Config extends Secure_Controller
|
||||
'line_sequence' => $this->input->post('line_sequence'),
|
||||
'last_used_invoice_number' =>$this->input->post('last_used_invoice_number'),
|
||||
'last_used_quote_number' =>$this->input->post('last_used_quote_number'),
|
||||
'quote_default_comments' => $this->input->post('quote_default_comments'),
|
||||
'work_order_enable' => $this->input->post('work_order_enable') != NULL,
|
||||
'work_order_format' => $this->input->post('work_order_format'),
|
||||
'last_used_work_order_number' =>$this->input->post('last_used_work_order_number')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$lang["config_address"] = "Company Address";
|
||||
$lang["config_address_required"] = "Company Address is a required field";
|
||||
@@ -209,6 +209,7 @@ $lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "Default Top Margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "Default Top Margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_quote_default_comments"] = "Default Quote Comments";
|
||||
$lang["config_receipt"] = "Receipt";
|
||||
$lang["config_receipt_configuration"] = "Receipt Print Settings";
|
||||
$lang["config_receipt_default"] = "Default";
|
||||
|
||||
@@ -209,6 +209,7 @@ $lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "Margin Top must be a number.";
|
||||
$lang["config_print_top_margin_required"] = "Margin Top is a required field.";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_quote_default_comments"] = "Default Quote Comments";
|
||||
$lang["config_receipt"] = "Receipt";
|
||||
$lang["config_receipt_configuration"] = "Receipt Print Settings";
|
||||
$lang["config_receipt_default"] = "Default";
|
||||
|
||||
@@ -224,3 +224,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('email_receipt_check_behaviour', 'last'),
|
||||
('print_receipt_check_behaviour', 'last');
|
||||
|
||||
|
||||
-- This is to provide distinct default comments for both quotes and invoices
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('quote_default_comments', 'This is a default quote comment');
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_quote_default_comments'), 'quote_default_comments', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-5'>
|
||||
<?php echo form_textarea(array(
|
||||
'name' => 'quote_default_comments',
|
||||
'id' => 'quote_default_comments',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('quote_default_comments')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_work_order_enable'), 'work_order_enable', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-1'>
|
||||
@@ -158,7 +169,7 @@ $(document).ready(function()
|
||||
var enable_disable_invoice_enable = (function() {
|
||||
var invoice_enabled = $("#invoice_enable").is(":checked");
|
||||
var work_order_enabled = $("#work_order_enable").is(":checked");
|
||||
$("#sales_invoice_format, #recv_invoice_format, #invoice_default_comments, #invoice_email_message, select[name='default_register_mode'], #sales_quote_format, select[name='line_sequence'], #last_used_invoice_number, #last_used_quote_number, #work_order_enable, #work_order_format, #last_used_work_order_number").prop("disabled", !invoice_enabled);
|
||||
$("#sales_invoice_format, #recv_invoice_format, #invoice_default_comments, #invoice_email_message, select[name='default_register_mode'], #sales_quote_format, select[name='line_sequence'], #last_used_invoice_number, #last_used_quote_number, #quote_default_comments, #work_order_enable, #work_order_format, #last_used_work_order_number").prop("disabled", !invoice_enabled);
|
||||
if(invoice_enabled) {
|
||||
$("#work_order_format, #last_used_work_order_number").prop("disabled", !work_order_enabled);
|
||||
} else {
|
||||
@@ -187,7 +198,7 @@ $(document).ready(function()
|
||||
submitHandler: function(form) {
|
||||
$(form).ajaxSubmit({
|
||||
beforeSerialize: function(arr, $form, options) {
|
||||
$("#sales_invoice_format, #sales_quote_format, #recv_invoice_format, #invoice_default_comments, #invoice_email_message, #last_used_invoice_number, #last_used_quote_number, #work_order_enable, #work_order_format, #last_used_work_order_number").prop("disabled", false);
|
||||
$("#sales_invoice_format, #sales_quote_format, #recv_invoice_format, #invoice_default_comments, #invoice_email_message, #last_used_invoice_number, #last_used_quote_number, #quote_default_comments, #work_order_enable, #work_order_format, #last_used_work_order_number").prop("disabled", false);
|
||||
return true;
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
@@ -214,7 +214,7 @@ $(document).ready(function()
|
||||
<div id="sale_return_policy">
|
||||
<h5>
|
||||
<textarea rows="5" cols="6"><?php echo nl2br($this->config->item('payment_message')); ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo $this->lang->line('sales_comments'). ': ' . $comments; ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo empty($comments) ? '' : $this->lang->line('sales_comments') . ': ' . $comments; ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo $this->config->item('invoice_default_comments'); ?></textarea>
|
||||
</h5>
|
||||
<?php echo nl2br($this->config->item('return_policy')); ?>
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<table id="info">
|
||||
<tr>
|
||||
<td id="logo">
|
||||
<?php if($this->config->item('company_logo') != '')
|
||||
{
|
||||
<?php if($this->config->item('company_logo') != '')
|
||||
{
|
||||
?>
|
||||
<img id="image" src="<?php echo 'uploads/' . $this->config->item('company_logo'); ?>" alt="company_logo" />
|
||||
<?php
|
||||
@@ -31,37 +31,37 @@
|
||||
?>
|
||||
</td>
|
||||
<td id="customer-title">
|
||||
<pre><?php if(isset($customer)) { echo $customer_info; } ?></pre>
|
||||
<pre><?php if(isset($customer)) { echo $customer_info; } ?></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="company-title">
|
||||
<pre><?php echo $this->config->item('company'); ?></pre>
|
||||
<pre><?php echo $company_info; ?></pre>
|
||||
<td id="company-title">
|
||||
<pre><?php echo $this->config->item('company'); ?></pre>
|
||||
<pre><?php echo $company_info; ?></pre>
|
||||
</td>
|
||||
<td id="meta">
|
||||
<table align="right">
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_invoice_number');?> </td>
|
||||
<td><div><?php echo $invoice_number; ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('common_date'); ?></td>
|
||||
<td><div><?php echo $transaction_date; ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
<td id="meta">
|
||||
<table align="right">
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_invoice_number');?> </td>
|
||||
<td><div><?php echo $invoice_number; ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('common_date'); ?></td>
|
||||
<td><div><?php echo $transaction_date; ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($amount_due > 0)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_amount_due'); ?></td>
|
||||
<td><div class="due"><?php echo to_currency($total); ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_amount_due'); ?></td>
|
||||
<td><div class="due"><?php echo to_currency($total); ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -125,10 +125,10 @@
|
||||
|
||||
<div id="terms">
|
||||
<div id="sale_return_policy">
|
||||
<h5>
|
||||
<div><?php echo nl2br($this->config->item('payment_message')); ?></div>
|
||||
<div><?php echo $this->lang->line('sales_comments'). ': ' . (empty($comments) ? $this->config->item('invoice_default_comments') : $comments); ?></div>
|
||||
</h5>
|
||||
<h5>
|
||||
<textarea rows="5" cols="6"><?php echo nl2br($this->config->item('payment_message')); ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo $this->lang->line('sales_comments') . ': ' . (empty($comments) ? $this->config->item('invoice_default_comments') : $comments); ?></textarea>
|
||||
</h5>
|
||||
<?php echo nl2br($this->config->item('return_policy')); ?>
|
||||
</div>
|
||||
<div id='barcode'>
|
||||
|
||||
@@ -189,9 +189,9 @@ if (isset($error_message))
|
||||
<div id="terms">
|
||||
<div id="sale_return_policy">
|
||||
<h5>
|
||||
<textarea rows="5" cols="6"><?php echo $this->lang->line('sales_comments'). ': ' . $comments; ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo $this->config->item('invoice_default_comments'); ?></textarea>
|
||||
</h5>
|
||||
<textarea rows="5" cols="6"><?php echo empty($comments) ? '' : $this->lang->line('sales_comments') . ': ' . $comments; ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo $this->config->item('quote_default_comments'); ?></textarea>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url() . 'css/invoice_email.css';?>"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url() . 'css/invoice_email.css';?>"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -18,90 +18,90 @@
|
||||
?>
|
||||
|
||||
<div id="page-wrap">
|
||||
<div id="header"><?php echo $this->lang->line('sales_quote'); ?></div>
|
||||
<table id="info">
|
||||
<tr>
|
||||
<td id="logo">
|
||||
<div id="header"><?php echo $this->lang->line('sales_quote'); ?></div>
|
||||
<table id="info">
|
||||
<tr>
|
||||
<td id="logo">
|
||||
<?php if($this->config->item('company_logo') != '')
|
||||
{
|
||||
?>
|
||||
<img id="image" src="<?php echo 'uploads/' . $this->config->item('company_logo'); ?>" alt="company_logo" />
|
||||
<img id="image" src="<?php echo 'uploads/' . $this->config->item('company_logo'); ?>" alt="company_logo" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td id="customer-title">
|
||||
<pre><?php if(isset($customer)) { echo $customer_info; } ?></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="company-title">
|
||||
<pre><?php echo $this->config->item('company'); ?></pre>
|
||||
<pre><?php echo $company_info; ?></pre>
|
||||
</td>
|
||||
<td id="meta">
|
||||
<table align="right">
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_quote_number');?> </td>
|
||||
<td><div><?php echo $quote_number; ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('common_date'); ?></td>
|
||||
<td><div><?php echo $transaction_date; ?></div></td>
|
||||
</tr>
|
||||
</td>
|
||||
<td id="customer-title">
|
||||
<pre><?php if(isset($customer)) { echo $customer_info; } ?></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="company-title">
|
||||
<pre><?php echo $this->config->item('company'); ?></pre>
|
||||
<pre><?php echo $company_info; ?></pre>
|
||||
</td>
|
||||
<td id="meta">
|
||||
<table align="right">
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_quote_number');?> </td>
|
||||
<td><div><?php echo $quote_number; ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('common_date'); ?></td>
|
||||
<td><div><?php echo $transaction_date; ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($amount_due > 0)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_amount_due'); ?></td>
|
||||
<td><div class="due"><?php echo to_currency($total); ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-head"><?php echo $this->lang->line('sales_amount_due'); ?></td>
|
||||
<td><div class="due"><?php echo to_currency($total); ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="items">
|
||||
<tr>
|
||||
<th><?php echo $this->lang->line('sales_item_number'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_item_name'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_price'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_discount'); ?></th>
|
||||
<table id="items">
|
||||
<tr>
|
||||
<th><?php echo $this->lang->line('sales_item_number'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_item_name'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_price'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_discount'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_customer_discount');?></th>
|
||||
<th><?php echo $this->lang->line('sales_total'); ?></th>
|
||||
</tr>
|
||||
<th><?php echo $this->lang->line('sales_total'); ?></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
foreach($cart as $line=>$item)
|
||||
{
|
||||
?>
|
||||
<tr class="item-row">
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td class="item-name"><?php echo $item['name']; ?></td>
|
||||
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo $item['discount'] .'%'; ?></td>
|
||||
<tr class="item-row">
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td class="item-name"><?php echo $item['name']; ?></td>
|
||||
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo $item['discount'] .'%'; ?></td>
|
||||
<td><?php echo to_currency($item['discounted_total'] / $item['quantity']); ?></td>
|
||||
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
|
||||
</tr>
|
||||
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td colspan="7" align="center"><?php echo ' '; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7" align="center"><?php echo ' '; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4" class="blank"> </td>
|
||||
<td colspan="2" class="total-line"><?php echo $this->lang->line('sales_sub_total'); ?></td>
|
||||
<tr>
|
||||
<td colspan="4" class="blank"> </td>
|
||||
<td colspan="2" class="total-line"><?php echo $this->lang->line('sales_sub_total'); ?></td>
|
||||
<td id="subtotal" class="total-value"><?php echo to_currency($subtotal); ?></td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
foreach($taxes as $tax_group_index=>$sales_tax)
|
||||
@@ -116,25 +116,26 @@
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td colspan="4" class="blank"> </td>
|
||||
<td colspan="2" class="total-line"><?php echo $this->lang->line('sales_total'); ?></td>
|
||||
<td id="total" class="total-value"><?php echo to_currency($total); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td colspan="4" class="blank"> </td>
|
||||
<td colspan="2" class="total-line"><?php echo $this->lang->line('sales_total'); ?></td>
|
||||
<td id="total" class="total-value"><?php echo to_currency($total); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="terms">
|
||||
<div id="sale_return_policy">
|
||||
<h5>
|
||||
<div><?php echo nl2br($this->config->item('payment_message')); ?></div>
|
||||
<div><?php echo $this->lang->line('sales_comments'). ': ' . (empty($comments) ? $this->config->item('invoice_default_comments') : $comments); ?></div>
|
||||
</h5>
|
||||
<div id="terms">
|
||||
<textarea id="sale_return_policy">
|
||||
<h5>
|
||||
<textarea rows="5" cols="6"><?php echo nl2br($this->config->item('payment_message')); ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo empty($comments) ? '' : $this->lang->line('sales_comments') . ': ' . $comments; ?></textarea>
|
||||
<textarea rows="5" cols="6"><?php echo $this->config->item('quote_default_comments'); ?></textarea>
|
||||
</h5>
|
||||
<?php echo nl2br($this->config->item('return_policy')); ?>
|
||||
</div>
|
||||
<div id='barcode'>
|
||||
</div>
|
||||
<div id='barcode'>
|
||||
<?php echo $quote_number; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -179,6 +179,13 @@ if (isset($error_message))
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<div id="terms">
|
||||
<div id="sale_return_policy">
|
||||
<h5>
|
||||
<textarea rows="5" cols="6"><?php echo empty($comments) ? '' : $this->lang->line('sales_comments') . ': ' . $comments; ?></textarea>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -124,14 +124,8 @@
|
||||
<div id="terms">
|
||||
<div id="sale_return_policy">
|
||||
<h5>
|
||||
<div><?php echo nl2br($this->config->item('payment_message')); ?></div>
|
||||
<div><?php echo $this->lang->line('sales_comments'). ': ' . (empty($comments) ? $this->config->item('invoice_default_comments') : $comments); ?></div>
|
||||
<textarea rows="5" cols="6"><?php echo empty($comments) ? '' : $this->lang->line('sales_comments') . ': ' . $comments; ?></textarea>
|
||||
</h5>
|
||||
<?php echo nl2br($this->config->item('return_policy')); ?>
|
||||
</div>
|
||||
<div id='barcode'>
|
||||
<img src='data:image/png;base64,<?php echo $barcode; ?>' /><br>
|
||||
<?php echo $sale_id; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -118,7 +118,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('suggestions_first_column', 'name'),
|
||||
('suggestions_second_column', ''),
|
||||
('suggestions_third_column', ''),
|
||||
('allow_duplicate_barcodes', '0');
|
||||
('allow_duplicate_barcodes', '0'),
|
||||
('quote_default_comments', 'This is a default quote comment');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
@@ -118,7 +118,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('suggestions_first_column', 'name'),
|
||||
('suggestions_second_column', ''),
|
||||
('suggestions_third_column', ''),
|
||||
('allow_duplicate_barcodes', '0');
|
||||
('allow_duplicate_barcodes', '0'),
|
||||
('quote_default_comments', 'This is a default quote comment');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
@@ -118,7 +118,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('suggestions_first_column', 'name'),
|
||||
('suggestions_second_column', ''),
|
||||
('suggestions_third_column', ''),
|
||||
('allow_duplicate_barcodes', '0');
|
||||
('allow_duplicate_barcodes', '0'),
|
||||
('quote_default_comments', 'This is a default quote comment');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user