[API Update Sale Orders] Không update được chi tiết hàng hóa trong đơn hàng [Closed]

Mình có gửi đầy đủ các properties trong docs swagger của misa crm, nhưng api chỉ update được các properties của đơn hàng, không update được
sale_order_product_mappings.
Kiểm tra giúp mình nhé, mình gửi JSON
JSON:
[
  {
    "owner_id": 4,
    "owner_id_text": "xxx",
    "form_layout_id": 37,
    "form_layout_id_text": "Mẫu tiêu chuẩn",
    "sale_order_no": "DH0001034",
    "sale_order_name": "Đơn hàng bán cho Test",
    "sale_order_date": "2023-09-24T00:00:00.000+07:00",
    "book_date": "2023-09-24T00:00:00.000+07:00",
    "account_id": 266,
    "account_name": "Test",
    "contact_id": 0,
    "sale_order_amount": 455425,
    "due_date": "2023-09-24T00:00:00.000+07:00",
    "sale_order_type": "Bán mới",
    "revenue_status_id": 1,
    "revenue_status": "Bản nháp",
    "recorded_sale": 0,
    "status": "Chưa thực hiện",
    "description": "",
    "is_use_currency": false,
    "currency_type": "VND",
    "exchange_rate": 1,
    "total_receipted_amount": 0,
    "balance_receipt_amount": 455425,
    "is_invoiced": false,
    "invoiced_amount": 0,
    "un_invoiced_amount": 455425,
    "un_subcrible": false,
    "billing_country": "",
    "billing_province": "",
    "billing_district": "",
    "billing_ward": "",
    "billing_address": "Hcm",
    "phone": "xxx",
    "shipping_country": "",
    "shipping_province": "",
    "shipping_district": "",
    "shipping_ward": "",
    "shipping_street": "",
    "shipping_address": "Hcm",
    "organization_unit_id": 1,
    "organization_unit_name": "xxx",
    "created_by": "Developer",
    "modified_by": "Developer",
    "is_public": false,
    "is_deleted": false,
    "total_summary": 455425,
    "tax_summary": 33735.19,
    "discount_summary": 0,
    "to_currency_summary": 421689.85000000003,
    "billing_account_id": 266,
    "billing_account": "Test",
    "is_sent_bill": false,
    "shipping_contact_name": "Test",
    "pay_status": "Chưa thanh toán",
    "shipping_amount_summary": 0,
    "sale_order_process_cost": 0,
    "amount_summary": 0,
    "liquidate_amount": 455425,
    "to_currency_summary_oc": 421689.85000000003,
    "discount_summary_oc": 0,
    "tax_summary_oc": 33735.19,
    "total_summary_oc": 455425,
    "liquidate_amount_oc": 455425,
    "sale_order_amount_oc": 455425,
    "total_receipted_amount_oc": 0,
    "balance_receipt_amount_oc": 455425,
    "invoiced_amount_oc": 0,
    "async_id": "a3875eaf-9cf1-45c8-bb50-91b0e51c362e",
    "sale_order_product_mappings": [
      {
        "product_id": 15814,
        "unit": "Thùng",
        "price": 26454.63,
        "amount": 15,
        "to_currency": 396819.45,
        "discount": 0,
        "tax": 31745.56,
        "total": 428565.01,
        "product_name": "TP00689",
        "product_code": "TP00689",
        "tax_percent": "0.08%",
        "discount_percent": 0,
        "shipping_amount": 0,
        "usage_unit": "Thùng",
        "ratio": 1,
        "usage_unit_price": 26454.63,
        "usage_unit_amount": 15,
        "operator": "Nhân",
        "stock_id": "1",
        "stock_name": "KHO TP",
        "description": "xxx",
        "to_currency_oc": 396819.45,
        "discount_oc": 0,
        "tax_oc": 31745.56,
        "total_oc": 428565.01,
        "is_discount_directly": false,
        "price_after_tax": 0,
        "sort_order": 1,
        "async_id": "c2698812-4d35-4d75-829b-1c84b18a0490"
      }
    ]
  }
]
 
Học thêm kiến thức tại: AMIS Blog | MISA Academy
dạ em đã nhận được thông tin của mình ạ. Anh làm việc bình thường nhé! Bên em sẽ sắp xếp nhân sự liên hệ và hỗ trợ mình ạ!
API v1 anh thấy có property async_id để đồng bộ id giữa 2 hệ thống. Nhưng lên v2 thì anh ko thấy nữa, em hỏi giúp anh bên kỹ thuật làm sao để đồng bộ ID giữa 2 hệ thống nhé. Anh cảm ơn!
 
Học thêm kiến thức tại: AMIS Blog | MISA Academy
Dạ thưa anh, nếu qua 17h30 bên em liên hệ anh có thể hẹn giờ vào ngày hôm sau để bên em liên hệ hỗ trợ mình anh nhé!
Dạ em không biết hiện tại mìnhđang gặp vấnđề gì vậyạ?
 
Học thêm kiến thức tại: AMIS Blog | MISA Academy
Với cả là anh thấy cách tài liệu mô tả với kết quả trả về thực tế nó không khớp với nhau. Trong tài liệu mô tả 'account_name' là mã khách hàng, nhưng thực chất là tên của khách hàng. Nếu vậy thì làm sao bên mình đẩy dữ liệu qua được? Mình có thao tác thử tạo 2 KH trùng tên thì hệ thống có báo lỗi, nhưng vẫn có case bị trùng, mình chả hiểu? Đội kỹ thuật check giúp mình nhé. Hãy xem ảnh đính kèm
 

Đính kèm

Sửa lần cuối:
Học thêm kiến thức tại: AMIS Blog | MISA Academy
dạ em đã nhận được thông tin của mình ạ. Anh làm việc bình thường nhé! Bên em sẽ sắp xếp nhân sự liên hệ và hỗ trợ mình ạ!
Hôm qua anh có trao đổi qua điện thoại với kỹ thuật là yêu cầu trả thêm dữ liệu cho api lấy danh sách đơn hàng (thêm trường account_number - Mã khách hàng). Nhờ em hỏi lại tình hình giúp anh nhé. Anh cám ơn
 
Học thêm kiến thức tại: AMIS Blog | MISA Academy
Dạ để em báo lại kĩ thuật kiểm tra và sẽ liên hệ và báo về cho bên mình anh nhé!
Bên anh cần api gấp để tiếp tục công việc trong xưởng. Em nhắn đến mấy bạn kỹ thuật check giúp anh nhé, vì hiện tại ảnh hưởng rất nhiều đến quá trình sản xuất đơn hàng bên anh
 
Học thêm kiến thức tại: AMIS Blog | MISA Academy
Kính thưa:Anh/ chị
Do bộ phân CRM bên em hôm nay không có ca nên em xin phép hẹn anh vào ngày mai các bạn CRM sẽ liên hệ lại anh qua SĐT: 0937 277 200 anh nhé!
Em cảm ơn ạ!
Api v2 vẫn lỗi quá trời lỗi em ơi. Có bạn gọi cho anh nhưng cứ đòi remote desktop thì anh k biết để làm gì, cái mà cần thiết là kiểm tra lại log bên misa thì không kiểm. Giờ anh dùng api cập nhật đơn hàng v2 vẫn báo lỗi. Anh cần 01 bạn kỹ thuật check log giúp anh, chứ tình trạng này nó kéo dài quá rồi, mất uy tín lắm!
 

Đính kèm

Học thêm kiến thức tại: AMIS Blog | MISA Academy
Dạ vâng ạ. Em đã báo lại kĩ thuật liên hệ cho mình ạ. Nhờ anh chú ý điện thoại giúp em nhé! Em cảm ơn ạ!
MST: 0315966005

Anh gửi CURL cho kỹ thuật kiểm tra hộ anh, anh test trên document thì bị lỗi nhừ này
Mã:
curl -X PUT "https://crmconnect.misa.vn/api/v2/SaleOrders" -H  "accept: */*" -H  "Clientid: tuantucrm" -H  "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYZSI6Ikw3Y1NNTmtjTk80K3J2M2FVYk5Na2c9PSIsImNsaWVudGlkIjoiODZFdGhPanMwc2FlY0kramxPQXZCUT09IiwiZXhwaXJlcyI6Ikd0NzIyN3dwbHc3ckZQZEovb1pVRm5TSlVkZmd1QlN1UEFQOTAycmJmTnM9IiwiaXNwbGF0Zm9ybSI6IjQ4QXNZMWpsV1JFZ2VDQ3JvQ1R1TVE9PSIsInVzZXJpZCI6IkVEYjZvek84UXp4eDZMTGZmSnhVaXplcC9ySjJvZ3RRd2l5dzFySWlvMGtZaEVraDJpWjl1cWZGT0FVeGNHNDciLCJuYmYiOjE2OTY5OTY4MjQsImV4cCI6MTY5NzA4MzIyNCwiaXNzIjoiTUlTQSIsImF1ZCI6IkFNSVNDUk0yIn0.Ggdl9r0jXlgFG4gWHpQ37tgKqCA5HoMncdYXft785Pk" -H  "Content-Type: application/json-patch+json" -d "[{\"form_layout\":37,\"id\":null,\"sale_order_no\":\"DH0001167\",\"sale_order_name\":\"Đơn hàng bán cho diem test\",\"sale_order_date\":\"2023-10-11T00:00:00+07:00\",\"account_name\":\"KH006661\",\"status\":\"Chưa thực hiện\",\"billing_address\":\"120 hoa mai\",\"shipping_address\":\"120 hoa mai\",\"phone\":\"0923508810\",\"sale_order_amount\":272913,\"sale_order_product_mappings\":[{\"tax_percent\":\"8%\",\"amount\":15,\"to_currency\":245236.05,\"description\":\"Thùng carton - 600D x 600R x 400C - 3 lớp( Kiểu A1 - QT_ND125/XDT100/XDT100-B)\",\"stock_name\":\"KHO TP\",\"discount\":0,\"price\":16349.07,\"product_code\":\"TP02038\",\"tax\":19618.88,\"total\":264854.93},{\"tax_percent\":\"8%\",\"amount\":3,\"to_currency\":7461.12,\"description\":\"Hộp carton - 100D x 100R x 200C - 3 lớp( Kiểu A1 - CL_2N.120+X.95-C)\",\"stock_name\":\"KHO TP\",\"discount\":0,\"price\":2487.04,\"product_code\":\"TP01836\",\"tax\":596.89,\"total\":8058.01}]}]"
Và đây là JSON
Mã:
[
  {
    "form_layout": 37,
    "id": null,
    "sale_order_no": "DH0001167",
    "sale_order_name": "Đơn hàng bán cho diem test",
    "sale_order_date": "2023-10-11T00:00:00+07:00",
    "account_name": "KH006661",
    "status": "Chưa thực hiện",
    "billing_address": "120 hoa mai",
    "shipping_address": "120 hoa mai",
    "phone": "0923508810",
    "sale_order_amount": 272913,
    "sale_order_product_mappings": [
      {
        "tax_percent": "8%",
        "amount": 15,
        "to_currency": 245236.05,
        "description": "Thùng carton - 600D x 600R x 400C - 3 lớp( Kiểu A1 - QT_ND125/XDT100/XDT100-B)",
        "stock_name": "KHO TP",
        "discount": 0,
        "price": 16349.07,
        "product_code": "TP02038",
        "tax": 19618.88,
        "total": 264854.93
      },
      {
        "tax_percent": "8%",
        "amount": 3,
        "to_currency": 7461.12,
        "description": "Hộp carton - 100D x 100R x 200C - 3 lớp( Kiểu A1 - CL_2N.120+X.95-C)",
        "stock_name": "KHO TP",
        "discount": 0,
        "price": 2487.04,
        "product_code": "TP01836",
        "tax": 596.89,
        "total": 8058.01
      }
    ]
  }
]
 

Đính kèm

Học thêm kiến thức tại: AMIS Blog | MISA Academy
Bên em đã hỗ trợ anh submit thành công api cập nhật đơn hàng bằng cách thêm property amount_summary vào đơn hàng. Nhưng số lượng của chi tiết hàng hóa bị set về = 0

CURL
Mã:
curl -X PUT "https://crmconnect.misa.vn/api/v2/SaleOrders" -H  "accept: */*" -H  "Clientid: tuantucrm" -H  "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55Y29kZSI6Ikw3Y1NNTmtjTk80K3J2M2FVYk5Na2c9PSIsImNsaWVudGlkIjoiODZFdGhPanMwc2FlY0kramxPQXZCUT09IiwiZXhwaXJlcyI6IlpRDhGQmRCbm5GZEhCQnFWNkQ1eStBTkVRN21iTWZxcWdFR2M9IiwiaXNwbGF0Zm9ybSI6IjQ4QXNZMWpsV1JFZ2VDQ3JvQ1R1TVE9PSIsInVzZXJpZCI6IkVEYjZvek84UXp4eDZMTGZmSnhVaXplcC9ySjJvZ3RRd2l5dzFySWlvMGtZaEVraDJpWjl1cWZGT0FVeGNHNDciLCJuYmYiOjE2OTcyMTY4NzcsImV4cCI6MTY5NzMwMzI3NywiaXNzIjoiTUlTQSIsImF1ZCI6IkFNSVNDUk0yIn0.sw0oTC7kWi0Iur0H_7Sng8es5LmtSpBCQITTNOSMXhY" -H  "Content-Type: application/json-patch+json" -d "[{\"form_layout\":37,\"id\":null,\"sale_order_no\":\"DH0001167\",\"sale_order_name\":\"Đơn hàng bán cho diem test\",\"sale_order_date\":\"2023-10-11T00:00:00+07:00\",\"account_name\":\"KH006661\",\"status\":\"Chưa thực hiện\",\"billing_address\":\"120 hoa mai\",\"shipping_address\":\"120 hoa mai\",\"phone\":\"0923508810\",\"sale_order_amount\":272913,\"amount_summary\":18,\"sale_order_product_mappings\":[{\"tax_percent\":\"8%\",\"amount\":15,\"to_currency\":245236.05,\"description\":\"Thùng carton - 600D x 600R x 400C - 3 lớp( Kiểu A1 - QT_ND125/XDT100/XDT100-B)\",\"stock_name\":\"KHO TP\",\"discount\":0,\"price\":16349.07,\"product_code\":\"TP02038\",\"tax\":19618.88,\"total\":264854.93},{\"tax_percent\":\"8%\",\"amount\":3,\"to_currency\":7461.12,\"description\":\"Hộp carton - 100D x 100R x 200C - 3 lớp( Kiểu A1 - CL_2N.120+X.95-C)\",\"stock_name\":\"KHO TP\",\"discount\":0,\"price\":2487.04,\"product_code\":\"TP01836\",\"tax\":596.89,\"total\":8058.01}]}]"

JSON
JSON:
[
  {
    "form_layout": 37,
    "sale_order_no": "DH0001167",
    "sale_order_name": "Đơn hàng bán cho diem test",
    "sale_order_date": "2023-10-11T00:00:00+07:00",
    "account_name": "KH006661",
    "status": "Chưa thực hiện",
    "billing_address": "120 hoa mai",
    "shipping_address": "120 hoa mai",
    "phone": "0923508810",
    "sale_order_amount": 272913,
    "amount_summary": 18,
    "sale_order_product_mappings": [
      {
        "tax_percent": "8%",
        "amount": 15,
        "to_currency": 245236.05,
        "description": "Thùng carton - 600D x 600R x 400C - 3 lớp( Kiểu A1 - QT_ND125/XDT100/XDT100-B)",
        "stock_name": "KHO TP",
        "discount": 0,
        "price": 16349.07,
        "product_code": "TP02038",
        "tax": 19618.88,
        "total": 264854.93
      },
      {
        "tax_percent": "8%",
        "amount": 3,
        "to_currency": 7461.12,
        "description": "Hộp carton - 100D x 100R x 200C - 3 lớp( Kiểu A1 - CL_2N.120+X.95-C)",
        "stock_name": "KHO TP",
        "discount": 0,
        "price": 2487.04,
        "product_code": "TP01836",
        "tax": 596.89,
        "total": 8058.01
      }
    ]
  }
]
 

Đính kèm

Học thêm kiến thức tại: AMIS Blog | MISA Academy
Top