|
@@ -198,7 +198,7 @@ class PosSales(http.Controller):
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠╩╗║ ║ ║║║ ╦║╣ ║ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠╩╗║ ║ ║║║ ╦║╣ ║ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╚═╝═╩╝╚═╝╚═╝ ╩ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╚═╝═╩╝╚═╝╚═╝ ╩ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
'''
|
|
'''
|
|
- def finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, user_id):
|
|
|
|
|
|
+ def finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, customer_pricelist_id, user_id):
|
|
# Imports
|
|
# Imports
|
|
from account_journal import get_currency
|
|
from account_journal import get_currency
|
|
from sale_order import create_sale_from_cart
|
|
from sale_order import create_sale_from_cart
|
|
@@ -212,7 +212,7 @@ class PosSales(http.Controller):
|
|
self.make_info_log('[OK] Getting journal')
|
|
self.make_info_log('[OK] Getting journal')
|
|
|
|
|
|
# Create sale order
|
|
# Create sale order
|
|
- sale_order = create_sale_from_cart(customer_id, cart_items, date_now, currency_id, payment_term_id, warehouse_id, user_id)
|
|
|
|
|
|
+ sale_order = create_sale_from_cart(customer_id, cart_items, date_now, currency_id, payment_term_id, warehouse_id, customer_pricelist_id, user_id)
|
|
self.make_info_log('[OK] Creating sale order')
|
|
self.make_info_log('[OK] Creating sale order')
|
|
|
|
|
|
return (sale_order.id, currency_id)
|
|
return (sale_order.id, currency_id)
|
|
@@ -222,9 +222,9 @@ class PosSales(http.Controller):
|
|
╠╣ ║║║║║╚═╗╠═╣ ╚═╗╠═╣║ ║╣ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╠╣ ║║║║║╚═╗╠═╣ ╚═╗╠═╣║ ║╣ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╩ ╩╩═╝╚═╝ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╩ ╩╩═╝╚═╝ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
'''
|
|
'''
|
|
- def finish_sale_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, payment, payment_method, bank_payment_data, warehouse_id, user_id):
|
|
|
|
|
|
+ def finish_sale_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, payment, payment_method, bank_payment_data, warehouse_id, customer_pricelist_id, user_id):
|
|
# Create budget
|
|
# Create budget
|
|
- sale_order_id, currency_id = finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, user_id)
|
|
|
|
|
|
+ sale_order_id, currency_id = finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, customer_pricelist_id, user_id)
|
|
|
|
|
|
# Imports
|
|
# Imports
|
|
from sale_order import confirm_sale_order
|
|
from sale_order import confirm_sale_order
|
|
@@ -375,6 +375,7 @@ class PosSales(http.Controller):
|
|
mode = row.get('mode', 'sale')
|
|
mode = row.get('mode', 'sale')
|
|
journal_id = row.get('journalId', None)
|
|
journal_id = row.get('journalId', None)
|
|
customer_id = row.get('customerId', None)
|
|
customer_id = row.get('customerId', None)
|
|
|
|
+ customer_pricelist_id = row.get('customerPricelistId', None)
|
|
cart_items = row.get('items', [])
|
|
cart_items = row.get('items', [])
|
|
payment_term_id = row.get('paymentTermId', None)
|
|
payment_term_id = row.get('paymentTermId', None)
|
|
warehouse_id = row.get('warehouseId', None)
|
|
warehouse_id = row.get('warehouseId', None)
|
|
@@ -384,10 +385,10 @@ class PosSales(http.Controller):
|
|
bank_payment_data = row.get('bankPaymentData', {})
|
|
bank_payment_data = row.get('bankPaymentData', {})
|
|
|
|
|
|
if mode == 'budget':
|
|
if mode == 'budget':
|
|
- finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, user_id)
|
|
|
|
|
|
+ finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, customer_pricelist_id, user_id)
|
|
|
|
|
|
if mode == 'sale':
|
|
if mode == 'sale':
|
|
- finish_sale_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, payment, payment_method, bank_payment_data, warehouse_id, user_id)
|
|
|
|
|
|
+ finish_sale_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, payment, payment_method, bank_payment_data, warehouse_id, customer_pricelist_id, user_id)
|
|
|
|
|
|
if mode == 'product_picking':
|
|
if mode == 'product_picking':
|
|
finish_process_picking(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, user_id)
|
|
finish_process_picking(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, user_id)
|