this.company_logo = null;
this.company_logo_base64 = '';
this.currency = null;
- this.shop = null;
this.company = null;
this.user = null;
this.users = [];
return self.fetch(
'pos.config',
- ['name','journal_ids','warehouse_id','journal_id','pricelist_id',
+ ['name','journal_ids','journal_id','pricelist_id',
'iface_self_checkout', 'iface_led', 'iface_cashdrawer',
'iface_payment_terminal', 'iface_electronic_scale', 'iface_barscan',
'iface_vkeyboard','iface_print_via_proxy','iface_scan_via_proxy',
self.config.iface_scan_via_proxy ||
self.config.iface_cashdrawer;
- return self.fetch('stock.warehouse',[],[['id','=', self.config.warehouse_id[0]]]);
- }).then(function(shops){
- self.shop = shops[0];
-
return self.fetch('product.pricelist',['currency_id'],[['id','=',self.config.pricelist_id[0]]]);
}).then(function(pricelists){
self.pricelist = pricelists[0];
}).then(function(packagings){
self.db.add_packagings(packagings);
- return self.fetch('product.public.category', ['id','name','parent_id','child_id','image'])
+ return self.fetch('pos.category', ['id','name','parent_id','child_id','image'])
}).then(function(categories){
self.db.add_categories(categories);
return self.fetch(
'product.product',
- ['name', 'list_price','price','public_categ_id', 'taxes_id', 'ean13', 'default_code', 'variants',
+ ['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code', 'variants',
'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
[['sale_ok','=',true],['available_in_pos','=',true]],
{pricelist: self.pricelist.id} // context for price
this.order.removeOrderline(this);
return;
}else{
- var quant = Math.max(parseFloat(quantity) || 0, 0);
+ var quant = parseFloat(quantity) || 0;
var unit = this.get_unit();
if(unit){
- this.quantity = Math.max(unit.rounding, round_pr(quant, unit.rounding));
- this.quantityStr = this.quantity.toFixed(Math.max(0,Math.ceil(Math.log(1.0 / unit.rounding) / Math.log(10))));
+ this.quantity = round_pr(quant, unit.rounding);
+ this.quantityStr = this.quantity.toFixed(Math.ceil(Math.log(1.0 / unit.rounding) / Math.log(10)));
}else{
this.quantity = quant;
this.quantityStr = '' + this.quantity;
var client = this.get('client');
var cashier = this.pos.cashier || this.pos.user;
var company = this.pos.company;
- var shop = this.pos.shop;
var date = new Date();
return {
hour: date.getHours(),
minute: date.getMinutes() ,
isostring: date.toISOString(),
+ localestring: date.toLocaleString(),
},
company:{
email: company.email,
phone: company.phone,
logo: this.pos.company_logo_base64,
},
- shop:{
- name: shop.name,
- },
currency: this.pos.currency,
};
},
}
},
switchSign: function() {
+ console.log('switchsing');
var oldBuffer;
oldBuffer = this.get('buffer');
this.set({
- buffer: oldBuffer[0] === '-' ? oldBuffer.substr(1) : "-" + oldBuffer
+ buffer: oldBuffer[0] === '-' ? oldBuffer.substr(1) : "-" + oldBuffer
});
this.trigger('set_value',this.get('buffer'));
},