def add_supplier_payment_detail(buy_id, supplier_id, paid, unpaid, payment_method, is_return=False, note=''): payment = Payment() payment.buy_id(buy_id) payment.supplier_id(supplier_id) payment.payment_method(payment_method) payment.paid(paid) payment.unpaid(unpaid) payment.create_op(common.config.login_user_info[0]) payment.create_time(time_utils.get_now()) payment.note(note) if is_return: payment.refund_type(Payment.returned()) else: payment.refund_type(Payment.payoff()) payment_handler.add_payment_detail(payment) if unpaid: supplier_handler.update_supplier_unpaid(supplier_id, unpaid)
def _add_payment_detail(self, paid: float, unpaid: float, ): payment = Payment() payment.buy_id(self.buy_id) payment_method = int(self.payment_method.currentData()) payment.payment_method(payment_method) payment.paid(paid) payment.unpaid(unpaid) payment.create_op(Common.config.login_user_info[0]) payment.create_time(time_utils.get_now()) payment.refund_type(Payment.payoff()) payment_handler.add_payment_detail(payment)