add hidden account, cart insert/delete

add hidden account support
add delete/payout buttons to carts
add backend product sales with pdf export
add frontend product sales with pdf export
add frontend ticket sales with pdf export
This commit is contained in:
2016-01-03 18:29:39 +01:00
parent 62bcb7ff27
commit 595f663820
43 changed files with 2154 additions and 24 deletions

View File

@@ -30,6 +30,8 @@ function ProductSell(o){
customer_cart: [],
id_account: null,
products : [],
url_delete_transaction : '',
url_pay_transaction : '',
};
@@ -55,6 +57,13 @@ function ProductSell(o){
// addDocumentKeypressedListener();
initAutocomplete();
disalbeMousewheelSpinOnNumberInput();
}
function disalbeMousewheelSpinOnNumberInput(){
$(':input[type=number]').on('mousewheel', function(e){
e.preventDefault();
});
}
/**
@@ -199,7 +208,7 @@ function ProductSell(o){
if ( event.which == 13 ) {
event.preventDefault();
event.stopImmediatePropagation();
$('#productsaleform-id_currency').focus();
submitSellAndAppend();
}
});
}
@@ -477,12 +486,16 @@ function ProductSell(o){
function createUserCartTable(){
$(app.defaults.selector_user_cart).transferList({
'transfers' : app.defaults.user_cart
'transfers' : app.defaults.user_cart,
'url_delete' : app.defaults.url_delete_transaction,
'url_pay' : app.defaults.url_pay_transaction,
});
}
function createCustomerCartTable(){
$(app.defaults.selector_customer_cart).transferList({
'transfers' : app.defaults.customer_cart
'transfers' : app.defaults.customer_cart,
'url_delete' : app.defaults.url_delete_transaction,
'url_pay' : app.defaults.url_pay_transaction,
});
}

View File

@@ -45,6 +45,8 @@ function TicketSell(o){
/**mark list paid url*/
url_pay_customer_card: '-',
url_pay_user_cart: '',
url_delete_transaction: '',
url_pay_transaction: '',
};
@@ -91,18 +93,23 @@ function TicketSell(o){
function createUserCartTable(){
$(app.defaults.selector_user_cart).transferList({
'transfers' : app.defaults.user_cart
'transfers' : app.defaults.user_cart,
'url_delete' : app.defaults.url_delete_transaction,
'url_pay' : app.defaults.url_pay_transaction,
});
}
function createCustomerCartTable(){
$(app.defaults.selector_customer_cart).transferList({
'transfers' : app.defaults.customer_cart
'transfers' : app.defaults.customer_cart,
'url_delete' : app.defaults.url_delete_transaction,
'url_pay' : app.defaults.url_pay_transaction,
});
}
function addSellButtons(){
addBehaviourBtnSellAndAppendToUserCart();
addBehaviourBtnAddToCustomerCart();
addBehaviourBtnSell();
}
function addBehaviourBtnSellAndAppendToUserCart(){
@@ -113,6 +120,10 @@ function TicketSell(o){
$('#btn_add_to_customer_cart').on('click',submitAddTicketToCustomerCart);
}
function submitSell(){
$('#ticketcreate-cart').val('');
$('#ticket_form').submit();
}
function submitAddTicketToUserCart(){
$('#ticketcreate-cart').val('user');
$('#ticket_form').submit();
@@ -123,6 +134,9 @@ function TicketSell(o){
$('#ticket_form').submit();
}
function addBehaviourBtnSell(){
$('#btn_sell').on('click',submitSell);
}
function addBehaviourPayoutUserCart( ){
// $( app.defaults.selector_btn_pay_user_cart ).on('click',function(){

View File

@@ -1,6 +1,8 @@
$.widget( "fitness.transferList", {
options: {
transfers: [],
url_delete : '',
url_pay : '',
columns: [
{ 'label' : 'Idő' },
@@ -8,6 +10,7 @@ $.widget( "fitness.transferList", {
{ 'label' : 'Ár' },
{ 'label' : 'Db' },
{ 'label' : 'Összesen' },
{ 'label' : '' },
],
footers: [
{
@@ -100,6 +103,14 @@ $.widget( "fitness.transferList", {
s += '<td class=\'product-money\' >';
s += transfer.money;
s += '</td>';
s += '<td class=\'product-action\' style="width: 110px;" >';
s += '<form action="'+this.options.url_pay +"&id="+ transfer.id_transfer +'" method="POST" >';
s += "<button type='submit' class='btn btn-success pull-left' style='margin-right: 3px;' title='Tranzakció kifizetve' ><span style='font-size: 10px;' class= 'glyphicon glyphicon-eur\'></span></button>";
s += '</form>';
s += '<form action="'+this.options.url_delete +"&id="+ transfer.id_transfer +'" method="POST">';
s += "<button type='submit' class='btn btn-danger pull-left' title='Tranzakció törlése' ><span style='font-size: 10px;' class= 'glyphicon glyphicon-trash\'></span></button>";
s += '</form>';
s += '</td>';
s += '</tr>';
break;
case 'footer':
@@ -120,6 +131,9 @@ $.widget( "fitness.transferList", {
s += "<td class=\'product-money\' >";
s += footer.total( params.transfers );
s += "</td>";
s += "<td >";
s += "";
s += "</td>";
s += "</tr>";
}
s += "</tfoot>";