รูปภาพแจ้งข่าว ทางเว็บบอร์ด openerpthailand.org ได้เปลี่ยนระบบเว็บบอร์ด ใหม่เป็น phpBB 3.1
  1. บุคคลทั่วไป จะไม่สามารถเข้าอ่านกระทู้บางบอร์ด แนะนำให้ท่าน สมัครสมาชิกคลิกตามลิงค์นี้
  2. สมาชิกใหม่ ถ้ายังไม่ได้แนะนำตัวจะไม่สามารถ ตั้งกระทู้ และ ดาวน์โหลด ไฟล์จากเว็บบอร์ดได้ ท่านจำเป็นต้องแนะนำตัวที่หมวดนี้
  3. ถ้ามีปัญหาการใช้งาน หรือ ข้อเสนอแนะใดๆ แนะนำได้ที่นี่
  4. ปุ่มรูปหัวใจใต้โพส แต่ละโพส ท่านสามารถกดเพื่อสื่อถึงคนโพสนั้นถูกใจท่าน
  5. ห้ามลง E-mail, เบอร์โทรส่วนตัว, Line id หรือข้อมูลส่วนตัวอื่นๆ เพื่อป้องกันการแอบอ้างและโฆษณาแฝง โดยสามารถติดต่อสมาชิกท่านอื่นผ่านระบบ PM ของบอร์ด
  6. ท่านสามารถปิดการแจ้งนี้ได้ ที่มุมขวาของกล่องข้อความนี้

บุคคลทั่วไปสามาเข้าสู่ระบบ ด้วย Account ของ FaceBook ได้แล้ว คลิกที่นี่ได้เลย

การ Set Payment Term

ตอบกระทู้


คำถามนี้ เพื่อป้องกันการส่งแบบอัตโนมัติจากสแปมบอท
รูปแสดงอารมณ์
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode เปิด
[img] เปิด
[flash] ปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: การ Set Payment Term

Re: การ Set Payment Term

โพสต์ โดย sofe_000 » จันทร์ 13 เม.ย. 2015 12:23 am

โปรแกรม ไม่ต้องแก้เพิ่ม ก็ เปิด อินวอย เป็น เปอร์เช็นได้นะค่ะ

Re: การ Set Payment Term

โพสต์ โดย naitae » อังคาร 07 เม.ย. 2015 7:56 pm

ขอบคุณมากๆ ครับ สุดยอดมากครับ ขอติดตามนะครับ

Re: การ Set Payment Term

โพสต์ โดย Bhurivaj » อังคาร 07 เม.ย. 2015 10:00 am

กำลังติดตามอยู่นะครับ ^ ^

Re: การ Set Payment Term

โพสต์ โดย kitcle » เสาร์ 04 เม.ย. 2015 6:38 pm

ในการใช้ Payment Term Advanced ในระบบบัญชี
ต้องมีการ customize เพิ่มโดยการ ต่อเติมคลาส account.payment.term และ account.payment.term.line
เมื่อจัดการในส่วน Model เรียบร้อยแล้ว
ไว้ผมจะมาจัดการในส่วนของ Views เพื่อแสดงผลต่อนะครับ ^_^

โค้ด: เลือกทั้งหมด

class account_payment_term(osv.osv):
    _inherit="account.payment.term"

    def compute(self, cr, uid, id, value, date_ref=False, context=None):

        if isinstance(id, list):
            id = id[0]
        if not date_ref:
            date_ref = datetime.now().strftime('%Y-%m-%d')
        pt = self.browse(cr, uid, id, context=context)
        amount = value
        result = []
        prec = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
        for line in pt.line_ids:
            if line.value == 'fixed':
                amt = round(line.value_amount, prec)
            elif line.value == 'procent':
                amt = round(value * line.value_amount, prec)
            elif line.value == 'balance':
                amt = round(amount, prec)
            elif line.value == 'division':
                amt = round(value / line.value_amount, prec)
            if amt:
                next_date = datetime.strptime(date_ref, '%Y-%m-%d')
                # Add months first
                next_date += relativedelta(months=line.months or 0)
                # Add days later
                next_date += relativedelta(days=line.days)
                if line.days2 < 0:
                    next_first_date = next_date + relativedelta(day=1,months=1) #Getting 1st of next month
                    next_date = next_first_date + relativedelta(days=line.days2)
                if line.days2 > 0:
                    next_date += relativedelta(day=line.days2, months=1)
                if line.exclude_month1 > 0:
                    if int(next_date.strftime('%m')) == line.exclude_month1:
                        next_date += relativedelta(months=1, day=line.exclude_day1)
                if line.exclude_month2 > 0:
                    if int(next_date.strftime('%m')) == line.exclude_month2:
                        next_date += relativedelta(months=1, day=line.exclude_day2)
                result.append( (next_date.strftime('%Y-%m-%d'), amt) )
                amount -= amt
        return result

account_payment_term()

class account_payment_term_line(osv.osv):
    _inherit = 'account.payment.term.line'

    _columns = {
        'months': fields.integer('Number of Months', help="Number of months to add to invoice date."),
        'exclude_month1': fields.integer('Trigger Month 1 ', help="First month to trigger the date."),
        'exclude_day1': fields.integer('Day 1 Default', help="Day of the next Month to set."),
        'exclude_month2': fields.integer('Trigger Month 2', help="Second month to trigger the date."),
        'exclude_day2': fields.integer('Day 2 Default', help="Day of the next Month to set."),
        'value': fields.selection([
            ('procent', 'Percent'),
            ('balance', 'Balance'),
            ('fixed', 'Fixed Amount'),
            ('division', 'Division'),
            ], 'Valuation', required=True, help="Select here the kind of valuation related to this payment term line. Note that you should have your last line with the type 'Balance' to ensure that the whole amount will be threated."),
        'value_amount': fields.float('Value Amount', digits=(12,4), help="For Value percent enter % ratio between 0-1."),
    }
account_payment_term_line()

การ Set Payment Term

โพสต์ โดย Bhurivaj » พุธ 01 เม.ย. 2015 11:51 am

ในกรณีที่ต้องการให้ตั้งการจ่ายเงินให้เป็น 50% แรกก่อนที่จะเริ่มทำงาน 7 วัน และ 50% หลังจากส่งมอบงานแล้ว มีวิธีการเซ็ตยังไงบ้างครับ

ข้างบน