Fix hide reception cart
- add property user_cart_on - add property product_sale_default_focus - add property ticket_create-price_editable - add discount product/ticket enabled
This commit is contained in:
@@ -34,6 +34,12 @@ function ProductSell(o){
|
||||
url_pay_transaction : '',
|
||||
value_number: '',
|
||||
name_number: '',
|
||||
user_cart_on: true,
|
||||
//if enter pressed in count field, what to submet: 'paid' or 'add_to_user_cart' action
|
||||
product_count_enter_action: 'user_cart',
|
||||
//barcode or autocomplete
|
||||
product_sale_default_focus: 'barcode',
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -53,10 +59,7 @@ function ProductSell(o){
|
||||
|
||||
createCarts();
|
||||
|
||||
addPayoutButtons();
|
||||
|
||||
productChanged();
|
||||
// addDocumentKeypressedListener();
|
||||
|
||||
initAutocomplete();
|
||||
disalbeMousewheelSpinOnNumberInput();
|
||||
@@ -68,13 +71,6 @@ function ProductSell(o){
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* payout out user or customer cart
|
||||
* */
|
||||
function addPayoutButtons(){
|
||||
// addBehaviourPayoutUserCart();
|
||||
// addBehaviourPayoutCustomerCart();
|
||||
}
|
||||
/**
|
||||
* display user and customer cart on page load
|
||||
* */
|
||||
@@ -111,41 +107,6 @@ function ProductSell(o){
|
||||
$("#productsaleform-id_discount").change(refreshCalculatedValues);
|
||||
}
|
||||
|
||||
function addDocumentKeypressedListener(){
|
||||
$( document ).keypress(function( event ) {
|
||||
|
||||
var tag = event.target.tagName.toLowerCase();
|
||||
if ( tag != 'input' && tag != 'textarea') {
|
||||
|
||||
resetSequenceIfToMuchTimePassedOrEnterWasPressed(event);
|
||||
|
||||
if ( event.which == 13 ) {
|
||||
app.enterPressed = 1;
|
||||
$( document ).trigger( "wordtyped", [ { originalEvent: event, 'word': app.seq } ] );
|
||||
}else {
|
||||
appendCharToSeq(event);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$( document ).on( "wordtyped", function( event, data ) {
|
||||
var word;
|
||||
word = data.word;
|
||||
if ( word.length > 0){
|
||||
if ( word.length >= 6 && word.length <= 9 ){
|
||||
//lookupuser
|
||||
}else{
|
||||
$("#filter_text").val(data.word);
|
||||
_lookupProduct(data.word);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function resetSequenceIfToMuchTimePassedOrEnterWasPressed(){
|
||||
var prevDate, timePassed;
|
||||
prevDate= app.keyDate;
|
||||
@@ -181,7 +142,11 @@ function ProductSell(o){
|
||||
* set the focus for text input #filter_text
|
||||
* */
|
||||
function setFocus(){
|
||||
$("#filter_text").focus();
|
||||
if ( app.defaults.product_sale_default_focus == 'barcode'){
|
||||
$("#filter_text").focus();
|
||||
}else{
|
||||
$("#product_search").focus();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -210,7 +175,18 @@ function ProductSell(o){
|
||||
if ( event.which == 13 ) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
submitSellAndAppend();
|
||||
|
||||
if ( app.defaults.user_cart_on ){
|
||||
if ( app.defaults.product_count_enter_action == 'user_cart'){
|
||||
submitSellAndAppend();
|
||||
}else{
|
||||
submitSell();
|
||||
}
|
||||
}else{
|
||||
submitSell();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -445,44 +421,6 @@ function ProductSell(o){
|
||||
$(app.defaults.selector_customer_cart ).transferList( 'option', 'transfers' , app.defaults.customer_cart );
|
||||
}
|
||||
|
||||
function addBehaviourPayoutUserCart( ){
|
||||
$( app.defaults.selector_btn_pay_user_cart ).on('click',function(){
|
||||
|
||||
$.ajax({
|
||||
url: app.defaults.url_pay_user_cart,
|
||||
type: 'post',
|
||||
data: {},
|
||||
success: function (response) {
|
||||
if ( response.code == 'success'){
|
||||
app.defaults.user_cart = response.transfers;
|
||||
refreshUserCart();
|
||||
$.notify(app.defaults.message_paid, { 'type' : 'success' });
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
function addBehaviourPayoutCustomerCart( ){
|
||||
$( app.defaults.selector_btn_pay_customer_cart ).on('click',function(){
|
||||
$.ajax({
|
||||
url: app.defaults.url_pay_customer_card,
|
||||
type: 'post',
|
||||
data: {},
|
||||
success: function (response) {
|
||||
if ( response.code == 'success'){
|
||||
app.defaults.customer_cart = response.customer_cart;
|
||||
refreshCustomerCart();
|
||||
}
|
||||
$.notify(response.message, { 'type' : response.code });
|
||||
},
|
||||
error: function(){
|
||||
alert('Hiba történt');
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function createUserCartTable(){
|
||||
$(app.defaults.selector_user_cart).transferList({
|
||||
|
||||
@@ -50,6 +50,8 @@ function TicketSell(o){
|
||||
url_pay_transaction: '',
|
||||
discounts : [],
|
||||
discount: null,
|
||||
//if user cart module is on or off
|
||||
user_cart_on: true
|
||||
|
||||
};
|
||||
|
||||
@@ -61,7 +63,7 @@ function TicketSell(o){
|
||||
addBehaviourDiscountChangedListener();
|
||||
useDefaults();
|
||||
createCarts();
|
||||
addPayoutButtons();
|
||||
// addPayoutButtons();
|
||||
addSellButtons();
|
||||
// addBehaviourBtnCartPaid();
|
||||
}
|
||||
@@ -82,16 +84,19 @@ function TicketSell(o){
|
||||
/**
|
||||
* payout out user or customer cart
|
||||
* */
|
||||
/*
|
||||
function addPayoutButtons(){
|
||||
// addBehaviourPayoutUserCart();
|
||||
// addBehaviourPayoutCustomerCart();
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* display user and customer cart on page load
|
||||
* */
|
||||
function createCarts(){
|
||||
createUserCartTable();
|
||||
if ( app.defaults.user_cart_on ){
|
||||
createUserCartTable();
|
||||
}
|
||||
createCustomerCartTable();
|
||||
}
|
||||
|
||||
@@ -117,7 +122,9 @@ function TicketSell(o){
|
||||
}
|
||||
|
||||
function addSellButtons(){
|
||||
addBehaviourBtnSellAndAppendToUserCart();
|
||||
if ( app.defaults.user_cart_on ){
|
||||
addBehaviourBtnSellAndAppendToUserCart();
|
||||
}
|
||||
addBehaviourBtnAddToCustomerCart();
|
||||
addBehaviourBtnSell();
|
||||
}
|
||||
@@ -148,44 +155,6 @@ function TicketSell(o){
|
||||
$('#btn_sell').on('click',submitSell);
|
||||
}
|
||||
|
||||
function addBehaviourPayoutUserCart( ){
|
||||
// $( app.defaults.selector_btn_pay_user_cart ).on('click',function(){
|
||||
//
|
||||
// $.ajax({
|
||||
// url: app.defaults.url_pay_user_cart,
|
||||
// type: 'post',
|
||||
// data: {},
|
||||
// success: function (response) {
|
||||
// if ( response.code == 'success'){
|
||||
// app.defaults.user_cart = response.transfers;
|
||||
// refreshUserCart();
|
||||
// $.notify(app.defaults.message_paid, { 'type' : 'success' });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
// });
|
||||
}
|
||||
function addBehaviourPayoutCustomerCart( ){
|
||||
// $( app.defaults.selector_btn_pay_customer_cart ).on('click',function(){
|
||||
// $.ajax({
|
||||
// url: app.defaults.url_pay_customer_card,
|
||||
// type: 'post',
|
||||
// data: {},
|
||||
// success: function (response) {
|
||||
// if ( response.code == 'success'){
|
||||
// app.defaults.customer_cart = response.customer_cart;
|
||||
// refreshCustomerCart();
|
||||
// }
|
||||
// $.notify(response.message, { 'type' : response.code });
|
||||
// },
|
||||
// error: function(){
|
||||
// alert('Hiba történt');
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
function addBehaviourTypeChangedListener(){
|
||||
|
||||
Reference in New Issue
Block a user