[minor] cleanups

This commit is contained in:
Rushabh Mehta 2016-06-10 12:34:41 +05:30
parent d395c7d54e
commit e0686b32f3
7 changed files with 32 additions and 17 deletions

View File

@ -20,7 +20,8 @@ def get_pos_data():
if pos_profile.get('name'):
pos_profile = frappe.get_doc('POS Profile', pos_profile.get('name'))
else:
frappe.msgprint(_("Warning Message: Create POS Profile"))
frappe.msgprint('<a href="#Form/POS Profile/New POS Profile">'
+ _("Welcome to POS: Create your POS Profile") + '</a>');
update_pos_profile_data(doc, pos_profile)
update_multi_mode_option(doc, pos_profile)
@ -69,7 +70,7 @@ def update_multi_mode_option(doc, pos_profile):
from frappe.model import default_fields
if not pos_profile:
for payment in frappe.get_all('Mode of Payment Account', fields=["default_account", "parent"],
for payment in frappe.get_all('Mode of Payment Account', fields=["default_account", "parent"],
filters = {'company': doc.company}):
payments = doc.append('payments', {})
payments.mode_of_payment = payment.parent

View File

@ -266,7 +266,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
"options": this.party,
"label": this.party,
"fieldname": this.party.toLowerCase(),
"placeholder": this.party
"placeholder": __("Select or add new customer")
},
parent: this.wrapper.find(".party-area"),
only_input: true,

View File

@ -82,23 +82,23 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
frm.add_custom_button(__("Close"), function() {
frm.set_value("status", "Closed");
frm.save();
}, __("Status"));
});
} else {
frm.add_custom_button(__("Reopen"), function() {
frm.set_value("status", "Open");
frm.save();
}, __("Status"));
});
}
}
if(doc.status!=="Lost") {
if(doc.status!=="Quotation") {
cur_frm.add_custom_button(__('Lost'),
cur_frm.cscript['Declare Opportunity Lost'], __("Status"));
cur_frm.cscript['Declare Opportunity Lost']);
}
cur_frm.add_custom_button(__('Quotation'),cur_frm.cscript.create_quotation, __("Make"));
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
cur_frm.add_custom_button(__('Quotation'),
cur_frm.cscript.create_quotation);
}
}

View File

@ -1,4 +1,9 @@
<div class="row pos-payment-row" type="{{type}}" idx={{idx}}>
<div class="col-xs-6"><h5 class="payment-mode text-ellipsis" idx="{{idx}}"> {{mode_of_payment}} </h5></div>
<div class="col-xs-6 text-right"><input disabled data-fieldtype="Currency" class="input-with-feedback form-control text-right amount" idx="{{idx}}" type="text" value="{{format_number(amount, 2)}}"></div>
<div class="col-xs-6 text-right">
<input disabled data-fieldtype="Currency"
style="cursor: pointer;"
class="input-with-feedback form-control text-right amount"
idx="{{idx}}" type="text" value="{{format_number(amount, 2)}}">
</div>
</div>

View File

@ -269,7 +269,7 @@ function load_erpnext_slides() {
"default": __("Products")},
{fieldtype:"Select", fieldname:"item_uom_" + i, label:__("UOM"),
options:[__("Unit"), __("Nos"), __("Box"), __("Pair"), __("Kg"), __("Set"),
__("Hour"), __("Minute")],
__("Hour"), __("Minute"), __("Litre"), __("Meter"), __("Gram")],
"default": __("Unit")},
{fieldtype: "Check", fieldname: "is_sales_item_" + i, label:__("We sell this Item"), default: 1},
{fieldtype: "Check", fieldname: "is_purchase_item_" + i, label:__("We buy this Item")},

View File

@ -120,6 +120,9 @@ def install(country=None):
{'uom_name': _('Unit'), 'doctype': 'UOM', 'name': _('Unit'), "must_be_whole_number": 1},
{'uom_name': _('Box'), 'doctype': 'UOM', 'name': _('Box'), "must_be_whole_number": 1},
{'uom_name': _('Kg'), 'doctype': 'UOM', 'name': _('Kg')},
{'uom_name': _('Meter'), 'doctype': 'UOM', 'name': _('Meter')},
{'uom_name': _('Litre'), 'doctype': 'UOM', 'name': _('Litre')},
{'uom_name': _('Gram'), 'doctype': 'UOM', 'name': _('Gram')},
{'uom_name': _('Nos'), 'doctype': 'UOM', 'name': _('Nos'), "must_be_whole_number": 1},
{'uom_name': _('Pair'), 'doctype': 'UOM', 'name': _('Pair'), "must_be_whole_number": 1},
{'uom_name': _('Set'), 'doctype': 'UOM', 'name': _('Set'), "must_be_whole_number": 1},
@ -127,11 +130,17 @@ def install(country=None):
{'uom_name': _('Minute'), 'doctype': 'UOM', 'name': _('Minute')},
# Mode of Payment
{'doctype': 'Mode of Payment', 'mode_of_payment': 'Check' if country=="United States" else _('Cheque')},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Cash')},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Credit Card')},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Wire Transfer')},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Bank Draft')},
{'doctype': 'Mode of Payment',
'mode_of_payment': 'Check' if country=="United States" else _('Cheque'),
'type': 'Bank'},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Cash'),
'type': 'Cash'},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Credit Card'),
'type': 'Bank'},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Wire Transfer'),
'type': 'Bank'},
{'doctype': 'Mode of Payment', 'mode_of_payment': _('Bank Draft'),
'type': 'Bank'},
# Activity Type
{'doctype': 'Activity Type', 'activity_type': _('Planning')},

View File

@ -8,12 +8,12 @@ frappe.ui.form.on("Issue", {
frm.add_custom_button(__("Close"), function() {
frm.set_value("status", "Closed");
frm.save();
}, __("Status"));
});
} else {
frm.add_custom_button(__("Reopen"), function() {
frm.set_value("status", "Open");
frm.save();
}, __("Status"));
});
}
}
});