From ec3b5ef00ee07bdf7559c8bdb6f857b7464c3fbe Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 31 Oct 2008 18:19:09 +0000 Subject: [PATCH] Added POS and cash sale support. --- admin/db/users_db.inc | 12 +- admin/users.php | 7 +- applications/setup.php | 1 + includes/current_user.inc | 7 + includes/ui/ui_lists.inc | 54 +++++++ sales/includes/cart_class.inc | 26 +++- sales/includes/db/sales_invoice_db.inc | 15 +- sales/includes/db/sales_order_db.inc | 5 +- sales/includes/sales_db.inc | 1 + sales/includes/ui/sales_order_ui.inc | 192 ++++++++++++++++--------- sales/sales_order_entry.php | 91 +++++++----- sql/alter2.1.sql | 19 ++- 12 files changed, 317 insertions(+), 113 deletions(-) diff --git a/admin/db/users_db.inc b/admin/db/users_db.inc index 32f7c88c..8580733f 100644 --- a/admin/db/users_db.inc +++ b/admin/db/users_db.inc @@ -1,13 +1,14 @@ add_module(_("Miscellaneous")); $this->add_lapp_function(1, _("Pa&yment Terms"),"admin/payment_terms.php?"); $this->add_lapp_function(1, _("Shi&pping Company"),"admin/shipping_companies.php?"); + $this->add_rapp_function(1, _("&Points of Sale"),"sales/manage/sales_points.php?"); $this->add_rapp_function(1, _("&Printers"),"admin/printers.php?"); $this->add_module(_("Maintanance")); diff --git a/includes/current_user.inc b/includes/current_user.inc index 05b98800..0e7a4a87 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -11,6 +11,7 @@ class current_user var $username; var $name; var $company; + var $pos; var $access; var $logged; @@ -48,6 +49,7 @@ class current_user $this->access = $myrow["full_access"]; $this->name = $myrow["real_name"]; + $this->pos = $myrow["pos"]; $this->loginname = $loginname; $this->username = $this->loginname; $this->prefs = new user_prefs($myrow); @@ -182,6 +184,11 @@ function user_company() return $_SESSION["wa_current_user"]->company; } +function user_pos() +{ + return $_SESSION["wa_current_user"]->pos; +} + function user_language() { return $_SESSION["wa_current_user"]->prefs->language(); diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index e53d0eb2..6b9d714d 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -1225,7 +1225,61 @@ function bank_accounts_list_row($label, $name, $selected_id=null, $submit_on_cha echo "\n"; return $str; } +//----------------------------------------------------------------------------------------------- + +function cash_accounts_list_row($label, $name, $selected_id=null, $submit_on_change=false) +{ + $sql = "SELECT ".TB_PREF."bank_accounts.account_code, bank_account_name, bank_curr_code + FROM ".TB_PREF."bank_accounts, ".TB_PREF."chart_master + WHERE ".TB_PREF."bank_accounts.account_code=".TB_PREF."chart_master.account_code" + . " AND ".TB_PREF."bank_accounts.account_type=3"; + + if ($label != null) + echo "$label\n"; + echo ""; + $str = combo_input($name, $selected_id, $sql, 'account_code', 'bank_account_name', + array( + 'format' => '_format_add_curr', + 'select_submit'=> $submit_on_change, + 'async' => true + ) ); + echo "\n"; + return $str; +} +//----------------------------------------------------------------------------------------------- + +function pos_list_row($label, $name, $selected_id=null, $spec_option=false, $submit_on_change=false) +{ + $sql = "SELECT id, pos_name FROM ".TB_PREF."sales_pos"; + + default_focus($name); + echo ''; + if ($label != null) + echo "$label\n"; + echo ""; + + $str = combo_input($name, $selected_id, $sql, 'id', 'pos_name', + array( + 'select_submit'=> $submit_on_change, + 'async' => true, + 'spec_option' =>$spec_option, + 'spec_id' => -1, + ) ); + echo "\n"; + return $str; +} +//----------------------------------------------------------------------------------------------- + +function sale_payment_list_cells($label, $name, $selected_id=null, $submit_on_change=false) +{ + if ($label != null) + echo "$label\n"; + echo ""; + $str = yesno_list($name, $selected_id, _('Cash'), _('Delayed'), $submit_on_change); + echo "\n"; + return $str; +} //----------------------------------------------------------------------------------------------- function class_list($name, $selected_id=null, $submit_on_change=false) diff --git a/sales/includes/cart_class.inc b/sales/includes/cart_class.inc index 78cf46a8..99113912 100644 --- a/sales/includes/cart_class.inc +++ b/sales/includes/cart_class.inc @@ -55,6 +55,12 @@ class cart var $tax_group_name; var $tax_group_array = null; // saves db queries var $price_factor; // ditto for price calculations + + var $pos; // user assigned POS + var $cash; // cash transaction + var $cash_account; + var $account_name; + var $cash_discount; // not used as of FA 2.1 //------------------------------------------------------------------------- // // $trans_no==0 => open new/direct document @@ -135,10 +141,23 @@ class cart if (!is_date_in_fiscalyear($this->document_date)) $this->document_date = end_fiscalyear(); $this->reference = references::get_next($this->trans_type); - if ($type == 10) + if ($type == 10) { $this->due_date = get_invoice_duedate($this->customer_id, $this->document_date); - else + $this->pos = user_pos(); + $pos = get_sales_point($this->pos); + $this->cash = !$pos['credit_sale']; + if (!$pos['cash_sale'] || !$pos['credit_sale']) + $this->pos = -1; // mark not editable payment type + else + $this->cash = date_diff($this->due_date, Today(), 'd')<2; + if ($this->cash) { + $this->Location = $pos['pos_location']; + $this->location_name = $pos['location_name']; + $this->cash_account = $pos['account_code']; + $this->account_name = $pos['bank_account_name']; + } + } else $this->due_date = add_days($this->document_date, sys_prefs::default_delivery_required_by()); } @@ -193,11 +212,12 @@ class cart } } - function set_customer($customer_id, $customer_name, $currency, $discount) + function set_customer($customer_id, $customer_name, $currency, $discount, $cdiscount=0) { $this->customer_name = $customer_name; $this->customer_id = $customer_id; $this->default_discount = $discount; + $this->cash_discount = $cdiscount; $this->customer_currency = $currency; } diff --git a/sales/includes/db/sales_invoice_db.inc b/sales/includes/db/sales_invoice_db.inc index c4303fc6..e63ce842 100644 --- a/sales/includes/db/sales_invoice_db.inc +++ b/sales/includes/db/sales_invoice_db.inc @@ -148,8 +148,21 @@ function write_sales_invoice(&$invoice) if ($trans_no == 0) { references::save_last($invoice->reference, 10); + if ($invoice->cash) { + $amount = $items_total + $items_added_tax + $invoice->freight_cost + + $freight_added_tax; + + // to use debtors.pmt_discount on cash sale: + // extend invoice entry page with final amount after discount + // and change line below. + $discount = 0; // $invoice->cash_discount*$amount; + $pmtno = write_customer_payment(0, $invoice->customer_id, + $invoice->Branch, $invoice->cash_account, $date_, 1, + references::get_next(12), $amount-$discount, $discount, + _('Cash invoice').' '.$invoice->trans_no); + add_cust_allocation($amount, 12, $pmtno, 10, $invoice_no); + } } - commit_transaction(); return $invoice_no; diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index 34e4ad9d..25e39abf 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -60,7 +60,7 @@ function add_sales_order(&$order) db_escape($order->Comments) .",'" . date2sql($order->document_date) . "', " . db_escape($order->sales_type) . ", " . - $_POST['ship_via'] ."," . + db_escape($order->ship_via)."," . db_escape($order->deliver_to) . "," . db_escape($order->delivery_address) . ", " . db_escape($order->phone) . ", " . @@ -454,7 +454,8 @@ function get_customer_to_order($customer_id) { .TB_PREF."sales_types.tax_included, " .TB_PREF."sales_types.factor, " .TB_PREF."debtors_master.curr_code, " - .TB_PREF."debtors_master.discount + .TB_PREF."debtors_master.discount," + .TB_PREF."debtors_master.pymt_discount FROM ".TB_PREF."debtors_master, " .TB_PREF."credit_status, " .TB_PREF."sales_types diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index 5c4fffdb..4f98c78f 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -7,6 +7,7 @@ include_once($path_to_root . "/sales/includes/db/sales_credit_db.inc"); include_once($path_to_root . "/sales/includes/db/sales_invoice_db.inc"); include_once($path_to_root . "/sales/includes/db/sales_delivery_db.inc"); include_once($path_to_root . "/sales/includes/db/sales_types_db.inc"); +include_once($path_to_root . "/sales/includes/db/sales_points_db.inc"); include_once($path_to_root . "/sales/includes/db/custalloc_db.inc"); include_once($path_to_root . "/sales/includes/db/cust_trans_db.inc"); include_once($path_to_root . "/sales/includes/db/cust_trans_details_db.inc"); diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index 2b2b0284..ae2bd964 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -34,38 +34,44 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id) $deliver = $myrow['address']; // in case no delivery address. - $order->set_customer($customer_id, $name, $myrow['curr_code'], $myrow['discount']); + $order->set_customer($customer_id, $name, $myrow['curr_code'], + $myrow['discount'], $myrow['pymt_discount']); // the sales type determines the price list to be used by default $order->set_sales_type($myrow['salestype'], $myrow['sales_type'], $myrow['tax_included'], $myrow['factor']); -// if ($order->Branch != 0) - { - $result = get_branch_to_order($customer_id, $branch_id); + $result = get_branch_to_order($customer_id, $branch_id); - if (db_num_rows($result) == 0) - { + if (db_num_rows($result) == 0) + { return _("The selected customer and branch are not valid, or the customer does not have any branches."); - } - - $myrow = db_fetch($result); + } - $order->set_branch($branch_id, $myrow["tax_group_id"], - $myrow["tax_group_name"], $myrow["phone"], $myrow["email"]); + $myrow = db_fetch($result); - $address = $myrow["br_post_address"]; + $order->set_branch($branch_id, $myrow["tax_group_id"], + $myrow["tax_group_name"], $myrow["phone"], $myrow["email"]); - if (strlen($address) <= 1) // if branch has no address - $address = $deliver; // set sales order address + $address = $myrow["br_post_address"]; - $order->set_location($myrow["default_location"], $myrow["location_name"]); - $order->set_delivery($myrow["default_ship_via"], $myrow["br_name"], + if (strlen($address) <= 1) // if branch has no address + $address = $deliver; // set sales order address + $order->set_delivery($myrow["default_ship_via"], $myrow["br_name"], $address); - if ($order->trans_type == 10) - $order->due_date = get_invoice_duedate($customer_id, $order->document_date); + if ($order->trans_type == 10) { + $order->due_date = get_invoice_duedate($customer_id, $order->document_date); + if ($order->pos != -1) + $order->cash = date_diff($order->due_date, Today(), 'd')<2; } - + if($order->cash ) { + if($order->pos != -1) { + $paym = get_sales_point($order->pos); + $order->set_location($paym["pos_location"], $paym["location_name"]); + } + } else + $order->set_location($myrow["default_location"], $myrow["location_name"]); + return $ret_error; } @@ -73,7 +79,7 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id) function display_order_summary($title, &$order, $editable_items=false) { - global $table_style, $path_to_root, $Ajax; + global $table_style, $path_to_root; display_heading($title); @@ -205,6 +211,7 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group $_POST['deliver_to'] = $order->deliver_to; $_POST['delivery_address'] = $order->delivery_address; $_POST['phone'] = $order->phone; + $_POST['cash'] = $order->cash; if ($order->trans_type == 10) { $_POST['delivery_date'] = $order->due_date; @@ -214,6 +221,7 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group $Ajax->activate('deliver_to'); $Ajax->activate('phone'); $Ajax->activate('delivery_address'); + $Ajax->activate('cash'); // change prices if necessary // what about discount in template case? if ($old_order->customer_currency != $order->customer_currency) { @@ -253,6 +261,26 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group echo ""; + if ($order->trans_type == 10 && $order->pos != -1) { + sale_payment_list_cells(_('Payment:'), 'cash', null, true); + $cash_payment = get_post('cash', 0); + // current user can issue both credit and cash invoices + if ($order->cash != $cash_payment) { + $order->cash = $cash_payment; + if ($cash_payment) { + $paym = get_sales_point(user_pos()); + $order->cash_account = $paym['pos_account']; + $order->account_name = $paym['bank_account_name']; + $_POST['Location'] = $order->Location = $paym['pos_location']; + $order->location_name = $paym['location_name']; + } + check_qoh($order); + $Ajax->activate('delivery'); + set_focus($order->pos == -1 ? 'delivery_date' : 'account'); + } + } else + hidden('cash', $order->cash); + if($editable) { $str = sales_types_list_row(_("Price List"), 'sales_type', null, true); } else { @@ -403,61 +431,95 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1) function display_delivery_details(&$order) { - global $table_style2; - if ($order->trans_type==10) - { - $title = _("Delivery Details"); - $delname = _("Due Date").':'; - } - elseif ($order->trans_type==13) - { - $title = _("Invoice Delivery Details"); - $delname = _("Invoice before").':'; - } - else - { - $title = _("Order Delivery Details"); - $delname = _("Required Delivery Date").':'; - } - display_heading($title); - echo "
"; - start_table("$table_style2 width=90%"); - echo "
"; // outer table - - echo ""; - - locations_list_row(_("Deliver from Location:"), 'Location', $order->Location); - - date_row($delname, 'delivery_date', - _('Enter requested day of delivery'), $order->due_date, 0, 0, 0); + global $table_style2, $Ajax; - text_row(_("Deliver To:"), 'deliver_to', $order->deliver_to, 40, 40, - _('Additional identifier for delivery e.g. name of receiving person')); +div_start('delivery'); - textarea_row(_("Address:"), 'delivery_address', $order->delivery_address, 35, 5, - _('Delivery address. Default is address of customer branch')); - text_row(_("Contact Phone Number:"), 'phone', $order->phone, 25, 25, - _('Phone number of ordering person. Defaults to branch phone number')); + if (get_post('cash', 0)) { // Direct payment sale + display_heading(_('Cash payment')); + echo "
"; + label_row(_("Deliver from Location:"), $order->location_name); - echo "
"; + hidden('Location', $order->Location); + label_row(_("Cash account:"), $order->account_name); + textarea_row(_("Comments:"), "Comments", $order->Comments, 31, 5); + echo "
"; + } else { - echo ""; // outer table + if ($order->trans_type==10) + { + $title = _("Delivery Details"); + $delname = _("Due Date").':'; + } + elseif ($order->trans_type==13) + { + $title = _("Invoice Delivery Details"); + $delname = _("Invoice before").':'; + } + else + { + $title = _("Order Delivery Details"); + $delname = _("Required Delivery Date").':'; + } + display_heading($title); + echo "
"; + start_table("$table_style2 width=90%"); + echo ""; // outer table + echo ""; + + locations_list_row(_("Deliver from Location:"), 'Location', null, + false, true); + if (list_updated('Location')) + check_qoh($order); + + date_row($delname, 'delivery_date', + $order->trans_type==30 ? _('Enter requested day of delivery') : '', + $order->due_date, 0, 0, 0); + text_row(_("Deliver To:"), 'deliver_to', $order->deliver_to, 40, 40, + _('Additional identifier for delivery e.g. name of receiving person')); + + textarea_row(_("Address:"), 'delivery_address', $order->delivery_address, 35, 5, + _('Delivery address. Default is address of customer branch')); + text_row(_("Contact Phone Number:"), 'phone', $order->phone, 25, 25, + _('Phone number of ordering person. Defaults to branch phone number')); - echo "
"; + echo "
"; - text_row(_("Customer Reference:"), 'cust_ref', $order->cust_ref, 25, 25, - _('Customer reference number for this order (if any)')); - textarea_row(_("Comments:"), "Comments", $order->Comments, 31, 5); + echo ""; // outer table - small_amount_row(_("Shipping Charge:"), 'freight_cost', - price_format(get_post('freight_cost',0))); + echo ""; - shippers_list_row(_("Shipping Company:"), 'ship_via', $order->ship_via); + text_row(_("Customer Reference:"), 'cust_ref', $order->cust_ref, 25, 25, + _('Customer reference number for this order (if any)')); + textarea_row(_("Comments:"), "Comments", $order->Comments, 31, 5); - echo "
"; + small_amount_row(_("Shipping Charge:"), 'freight_cost', + price_format(get_post('freight_cost',0))); - echo ""; - end_table(1); // outer table + shippers_list_row(_("Shipping Company:"), 'ship_via', $order->ship_via); + echo ""; + echo ""; + end_table(1); // outer table + } + div_end(); } +function check_qoh($order) +{ + $msg = ''; + foreach($order->line_items as $line_no => $line) { + $qoh = get_qoh_on_date($line->stock_id, $_POST['Location'], $_POST['OrderDate']); + if ($line->qty_dispatched > $qoh) { + $msg .= $line->stock_id . " - " . $line->item_description . ": " . + _("Quantity On Hand") . " = " + . number_format2($qoh, get_qty_dec($line->stock_id)) . '
'; + } + } + if (strlen($msg)) { + display_error(_("The delivery cannot be processed because there is an insufficient quantity for item:") + . '
'. $msg); + return false; + } + return true; +} ?> \ No newline at end of file diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index edfc3455..3017f022 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -143,19 +143,28 @@ function copy_to_cart() if ($cart->trans_type!=30) { $cart->reference = $_POST['ref']; - } + } $cart->Comments = $_POST['Comments']; $cart->document_date = $_POST['OrderDate']; - $cart->due_date = $_POST['delivery_date']; - $cart->cust_ref = $_POST['cust_ref']; - $cart->freight_cost = input_num('freight_cost'); - $cart->deliver_to = $_POST['deliver_to']; - $cart->delivery_address = $_POST['delivery_address']; - $cart->phone = $_POST['phone']; - $cart->Location = $_POST['Location']; - $cart->ship_via = $_POST['ship_via']; - + if ($cart->trans_type == 10) + $cart->cash = $_POST['cash']; + if ($cart->cash) { + $cart->due_date = $cart->document_date; + $cart->phone = $cart->cust_ref = $cart->delivery_address = ''; + $cart->freight_cost = 0; + $cart->ship_via = 1; + $cart->deliver_to = '';//$_POST['deliver_to']; + } else { + $cart->due_date = $_POST['delivery_date']; + $cart->cust_ref = $_POST['cust_ref']; + $cart->freight_cost = input_num('freight_cost'); + $cart->deliver_to = $_POST['deliver_to']; + $cart->delivery_address = $_POST['delivery_address']; + $cart->phone = $_POST['phone']; + $cart->Location = $_POST['Location']; + $cart->ship_via = $_POST['ship_via']; + } if (isset($_POST['email'])) $cart->email =$_POST['email']; else @@ -163,6 +172,7 @@ function copy_to_cart() $cart->customer_id = $_POST['customer_id']; $cart->Branch = $_POST['branch_id']; $cart->sales_type = $_POST['sales_type']; + // POS } //----------------------------------------------------------------------------- @@ -190,6 +200,9 @@ function copy_from_cart() $_POST['branch_id'] = $cart->Branch; $_POST['sales_type'] = $cart->sales_type; + // POS + if ($cart->trans_type == 10) + $_POST['cash'] = $cart->cash; } //-------------------------------------------------------------------------------- @@ -217,35 +230,38 @@ function can_process() { set_focus('AddItem'); return false; } + if ($_SESSION['Items']->cash == 0) { if (strlen($_POST['deliver_to']) <= 1) { display_error(_("You must enter the person or company to whom delivery should be made to.")); set_focus('deliver_to'); return false; } - if (strlen($_POST['delivery_address']) <= 1) { - display_error( _("You should enter the street address in the box provided. Orders cannot be accepted without a valid street address.")); - set_focus('delivery_address'); - return false; - } - if ($_POST['freight_cost'] == "") - $_POST['freight_cost'] = price_format(0); + if (strlen($_POST['delivery_address']) <= 1) { + display_error( _("You should enter the street address in the box provided. Orders cannot be accepted without a valid street address.")); + set_focus('delivery_address'); + return false; + } - if (!check_num('freight_cost',0)) { - display_error(_("The shipping cost entered is expected to be numeric.")); - set_focus('freight_cost'); - return false; - } - if (!is_date($_POST['delivery_date'])) { - display_error(_("The delivery date is invalid.")); - set_focus('delivery_date'); - return false; - } - //if (date1_greater_date2($_SESSION['Items']->document_date, $_POST['delivery_date'])) { - if (date1_greater_date2($_POST['OrderDate'], $_POST['delivery_date'])) { - display_error(_("The requested delivery date is before the date of the order.")); - set_focus('delivery_date'); - return false; + if ($_POST['freight_cost'] == "") + $_POST['freight_cost'] = price_format(0); + + if (!check_num('freight_cost',0)) { + display_error(_("The shipping cost entered is expected to be numeric.")); + set_focus('freight_cost'); + return false; + } + if (!is_date($_POST['delivery_date'])) { + display_error(_("The delivery date is invalid.")); + set_focus('delivery_date'); + return false; + } + //if (date1_greater_date2($_SESSION['Items']->document_date, $_POST['delivery_date'])) { + if (date1_greater_date2($_POST['OrderDate'], $_POST['delivery_date'])) { + display_error(_("The requested delivery date is before the date of the order.")); + set_focus('delivery_date'); + return false; + } } if ($_SESSION['Items']->trans_type != 30 && !references::is_valid($_POST['ref'])) { display_error(_("You must enter a reference.")); @@ -409,9 +425,16 @@ function create_cart($type, $trans_no) $doc->trans_type = $type; $doc->trans_no = 0; $doc->document_date = Today(); // 2006-06-15. Added so Invoices and Deliveries get current day - if ($type == 10) + if ($type == 10) { $doc->due_date = get_invoice_duedate($doc->customer_id, $doc->document_date); - else + $doc->pos = user_pos(); + $pos = get_sales_point($doc->pos); + $doc->cash = $pos['cash_sale']; + if (!$pos['cash_sale'] || !$pos['credit_sale']) + $doc->pos = -1; // mark not editable payment type + else + $doc->cash = date_diff($doc->due_date, Today(), 'd')<2; + } else $doc->due_date = $doc->document_date; $doc->reference = references::get_next($doc->trans_type); $doc->Comments=''; diff --git a/sql/alter2.1.sql b/sql/alter2.1.sql index 85127db6..2fe22c85 100644 --- a/sql/alter2.1.sql +++ b/sql/alter2.1.sql @@ -1,3 +1,21 @@ +DROP TABLE IF EXISTS `0_sales_pos`; + +CREATE TABLE `0_sales_pos` ( + `id` smallint(6) NOT NULL auto_increment, + `pos_name` varchar(30) NOT NULL, + `cash_sale` tinyint(1) NOT NULL, + `credit_sale` tinyint(1) NOT NULL, + `pos_location` varchar(5) NOT NULL, + `pos_account` varchar(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY(`pos_name`) +) ENGINE=MyISAM AUTO_INCREMENT=3; + +INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '1705'); +INSERT INTO `0_sales_pos` VALUES ('2', 'Cash sale', '1', '0', 'CWA', '1705'); + +ALTER TABLE `0_users` ADD `pos` SMALLINT(6) DEFAULT '1'; + DROP TABLE IF EXISTS `0_quick_entries`; CREATE TABLE `0_quick_entries` ( @@ -13,7 +31,6 @@ INSERT INTO `0_quick_entries` VALUES ('1', 'Maintenance', '6600', '0'); INSERT INTO `0_quick_entries` VALUES ('2', 'Phone', '6730', '0'); INSERT INTO `0_quick_entries` VALUES ('3', 'Cash Sales', '3000', '1'); - ALTER TABLE `0_users` ADD `print_profile` VARCHAR(30) DEFAULT '' AFTER `show_hints` ; ALTER TABLE `0_users` ADD `rep_popup` TINYINT(1) DEFAULT '1' AFTER `print_profile` ; -- 2.30.2