예제 #1
0
 def on_credit__toggled(self, widget):
     if self.credit.get_active():
         msg = (
             _("The client will receive %s in credit for future purchases")
             % format_price(self.returned_total.read()))
         self.message.set_text(msg)
         self.wizard.credit = True
예제 #2
0
파일: paymentslave.py 프로젝트: romaia/stoq
 def _update_difference_label(self):
     difference = self.get_total_difference()
     if not difference:
         label_name = _('Difference')
     elif difference > 0:
         label_name = _('Overpaid:')
     elif difference < 0:
         label_name = _('Outstanding:')
         difference *= -1
     difference = format_price(difference, True, DECIMAL_PRECISION)
     self.difference_label.set_text(difference)
     self.difference_status_label.set_text(label_name)
예제 #3
0
파일: salewizard.py 프로젝트: Farrapo/stoq
 def _update_next_step(self, method):
     received_value = self.cash_change_slave.received_value
     if method and method.method_name == u'money':
         self.wizard.enable_finish()
         if self.wizard.need_create_payment():
             self.cash_change_slave.enable_cash_change()
         else:
             # In this case, the user has already paid more than the total
             # sale amount.
             self.cash_change_slave.disable_cash_change()
     elif method and method.method_name == u'credit':
         self.wizard.enable_finish()
         if self.wizard.need_create_payment():
             received_value.set_text(format_price(self.get_remaining_value()))
         self.cash_change_slave.disable_cash_change()
     else:
         self.wizard.disable_finish()
         if self.wizard.need_create_payment():
             received_value.set_text(format_price(self.get_remaining_value()))
         else:
             self.wizard.enable_finish()
         self.cash_change_slave.disable_cash_change()
예제 #4
0
파일: salewizard.py 프로젝트: esosaja/stoq
 def _update_next_step(self, method):
     received_value = self.cash_change_slave.received_value
     if method and method.method_name == u'money':
         self.wizard.enable_finish()
         if self.wizard.need_create_payment():
             self.cash_change_slave.enable_cash_change()
         else:
             # In this case, the user has already paid more than the total
             # sale amount.
             self.cash_change_slave.disable_cash_change()
     elif method and method.method_name == u'credit':
         self.wizard.enable_finish()
         if self.wizard.need_create_payment():
             received_value.set_text(format_price(self.get_remaining_value()))
         self.cash_change_slave.disable_cash_change()
     else:
         self.wizard.disable_finish()
         if self.wizard.need_create_payment():
             received_value.set_text(format_price(self.get_remaining_value()))
         else:
             self.wizard.enable_finish()
         self.cash_change_slave.disable_cash_change()
예제 #5
0
파일: formatters.py 프로젝트: tmaxter/stoq
def get_formatted_price(float_value, symbol=True, precision=DECIMAL_PRECISION):
    return format_price(float_value, symbol=symbol,
                        precision=precision)
예제 #6
0
파일: paymentslave.py 프로젝트: romaia/stoq
 def _setup_widgets(self):
     self.payment_list.set_columns(self._get_columns())
     self.total_label.set_text(format_price(self.total_value, True,
                                            DECIMAL_PRECISION))