Raph01
April 18, 2023, 6:41pm
1
Hello,
I migrate my website v11 from v14 with data import about :
Work Order
Stock Entry
Stock Reconciliation
Purchase Order
Purchase Invoice
Payment Entry
BOM
Batch
All my Stock Entry and Purchase Invoice was imported.
But my Purchase Order, still has To receive To bill
badge, while the connection between Purchase Order <> Purchase Invoice <> Purchase Receipt is linked.
How can I force the badge to be completed
or ask ErpNext to force a new update about the badge ?
Thank you
Raph01
November 10, 2023, 1:05pm
3
UP, I didn’t close this problem.
It’s painful to see every day that the purchase orders are not completed on the list.
bahaou
November 10, 2023, 1:12pm
4
@Raph01 all the po ? even the new ones ?
Raph01
November 10, 2023, 2:10pm
5
The new one, works fine, all it’s ok.
The problem was the imported PO for my migration from v11 to v14.
bahaou
November 10, 2023, 2:15pm
6
you can open console and manually edit the database
Raph01
November 10, 2023, 2:17pm
7
Good idea, Do you know which table I have to set ?
bahaou
November 10, 2023, 2:19pm
8
@Raph01 It’s Purchase Order of course
Raph01
November 10, 2023, 3:44pm
9
So the Table “tabPurchase Order” the fields of this table is
+---------------------------------+---------------+------+-----+-----------------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------------+---------------+------+-----+-----------------+-------+
| name | varchar(140) | NO | PRI | NULL | |
| creation | datetime(6) | YES | | NULL | |
| modified | datetime(6) | YES | MUL | NULL | |
| modified_by | varchar(140) | YES | | NULL | |
| owner | varchar(140) | YES | | NULL | |
| docstatus | int(1) | NO | | 0 | |
| idx | int(8) | NO | | 0 | |
| title | varchar(140) | YES | | {supplier_name} | |
| naming_series | varchar(140) | YES | | NULL | |
| supplier | varchar(140) | YES | MUL | NULL | |
| supplier_name | varchar(140) | YES | | NULL | |
| order_confirmation_no | varchar(140) | YES | | NULL | |
| order_confirmation_date | date | YES | | NULL | |
| transaction_date | date | YES | MUL | NULL | |
| schedule_date | date | YES | | NULL | |
| company | varchar(140) | YES | | NULL | |
| apply_tds | int(1) | NO | | 0 | |
| tax_withholding_category | varchar(140) | YES | | NULL | |
| is_subcontracted | int(1) | NO | | 0 | |
| supplier_warehouse | varchar(140) | YES | | NULL | |
| amended_from | varchar(140) | YES | | NULL | |
| cost_center | varchar(140) | YES | | NULL | |
| project | varchar(140) | YES | | NULL | |
| currency | varchar(140) | YES | | NULL | |
| conversion_rate | decimal(21,9) | NO | | 0.000000000 | |
| buying_price_list | varchar(140) | YES | | NULL | |
| price_list_currency | varchar(140) | YES | | NULL | |
| plc_conversion_rate | decimal(21,9) | NO | | 0.000000000 | |
| ignore_pricing_rule | int(1) | NO | | 0 | |
| scan_barcode | varchar(140) | YES | | NULL | |
| set_from_warehouse | varchar(140) | YES | | NULL | |
| set_warehouse | varchar(140) | YES | | NULL | |
| total_qty | decimal(21,9) | NO | | 0.000000000 | |
| total_net_weight | decimal(21,9) | NO | | 0.000000000 | |
| base_total | decimal(21,9) | NO | | 0.000000000 | |
| base_net_total | decimal(21,9) | NO | | 0.000000000 | |
| total | decimal(21,9) | NO | | 0.000000000 | |
| net_total | decimal(21,9) | NO | | 0.000000000 | |
| tax_withholding_net_total | decimal(21,9) | NO | | 0.000000000 | |
| base_tax_withholding_net_total | decimal(21,9) | NO | | 0.000000000 | |
| set_reserve_warehouse | varchar(140) | YES | | NULL | |
| tax_category | varchar(140) | YES | | NULL | |
| taxes_and_charges | varchar(140) | YES | | NULL | |
| shipping_rule | varchar(140) | YES | | NULL | |
| incoterm | varchar(140) | YES | | NULL | |
| named_place | varchar(140) | YES | | NULL | |
| base_taxes_and_charges_added | decimal(21,9) | NO | | 0.000000000 | |
| base_taxes_and_charges_deducted | decimal(21,9) | NO | | 0.000000000 | |
| base_total_taxes_and_charges | decimal(21,9) | NO | | 0.000000000 | |
| taxes_and_charges_added | decimal(21,9) | NO | | 0.000000000 | |
| taxes_and_charges_deducted | decimal(21,9) | NO | | 0.000000000 | |
| total_taxes_and_charges | decimal(21,9) | NO | | 0.000000000 | |
| base_grand_total | decimal(21,9) | NO | | 0.000000000 | |
| base_rounding_adjustment | decimal(21,9) | NO | | 0.000000000 | |
| base_in_words | varchar(240) | YES | | NULL | |
| base_rounded_total | decimal(21,9) | NO | | 0.000000000 | |
| grand_total | decimal(21,9) | NO | | 0.000000000 | |
| rounding_adjustment | decimal(21,9) | NO | | 0.000000000 | |
| rounded_total | decimal(21,9) | NO | | 0.000000000 | |
| disable_rounded_total | int(1) | NO | | 0 | |
| in_words | varchar(240) | YES | | NULL | |
| advance_paid | decimal(21,9) | NO | | 0.000000000 | |
| apply_discount_on | varchar(140) | YES | | Grand Total | |
| base_discount_amount | decimal(21,9) | NO | | 0.000000000 | |
| additional_discount_percentage | decimal(21,9) | NO | | 0.000000000 | |
| discount_amount | decimal(21,9) | NO | | 0.000000000 | |
| other_charges_calculation | longtext | YES | | NULL | |
| supplier_address | varchar(140) | YES | | NULL | |
| address_display | text | YES | | NULL | |
| contact_person | varchar(140) | YES | | NULL | |
| contact_display | text | YES | | NULL | |
| contact_mobile | text | YES | | NULL | |
| contact_email | text | YES | | NULL | |
| shipping_address | varchar(140) | YES | | NULL | |
| shipping_address_display | text | YES | | NULL | |
| billing_address | varchar(140) | YES | | NULL | |
| billing_address_display | text | YES | | NULL | |
| customer | varchar(140) | YES | | NULL | |
| customer_name | varchar(140) | YES | | NULL | |
| customer_contact_person | varchar(140) | YES | | NULL | |
| customer_contact_display | text | YES | | NULL | |
| customer_contact_mobile | text | YES | | NULL | |
| customer_contact_email | longtext | YES | | NULL | |
| payment_terms_template | varchar(140) | YES | | NULL | |
| tc_name | varchar(140) | YES | | NULL | |
| terms | longtext | YES | | NULL | |
| status | varchar(140) | YES | MUL | Draft | |
| per_billed | decimal(21,9) | NO | | 0.000000000 | |
| per_received | decimal(21,9) | NO | | 0.000000000 | |
| letter_head | varchar(140) | YES | | NULL | |
| group_same_items | int(1) | NO | | 0 | |
| select_print_heading | varchar(140) | YES | | NULL | |
| language | varchar(140) | YES | | NULL | |
| from_date | date | YES | | NULL | |
| to_date | date | YES | | NULL | |
| auto_repeat | varchar(140) | YES | | NULL | |
| is_internal_supplier | int(1) | NO | | 0 | |
| represents_company | varchar(140) | YES | | NULL | |
| ref_sq | varchar(140) | YES | | NULL | |
| party_account_currency | varchar(140) | YES | | NULL | |
| inter_company_order_reference | varchar(140) | YES | | NULL | |
| is_old_subcontracting_flow | int(1) | NO | | 0 | |
| _user_tags | text | YES | | NULL | |
| _comments | text | YES | | NULL | |
| _assign | text | YES | | NULL | |
| _liked_by | text | YES | | NULL | |
| delivery_details | text | YES | | NULL | |
+---------------------------------+---------------+------+-----+-----------------+-------+
I made a SQL update :
UPDATE `tabPurchase Order` SET `status` = 'Completed'
WHERE `creation` < '2023-04-15' AND NOT `status` IN ('Closed', 'Cancelled', 'Completed');
It succeed : Query OK, 326 rows affected (0.026 sec) Rows matched: 326 Changed: 326 Warnings: 0
But when I reload my Purchase Order View List I don’t see any change, my PO still “To Receive and To Bill” I don’t understand why.
bahaou
November 10, 2023, 3:50pm
10
@Raph01 actually you have to update 2 fields , per_billed and per_delivered . it’s the percentage of billing and delivering , so you change them to 100
Raph01
November 10, 2023, 4:10pm
11
Raph01:
per_received
Thank you, problem solved.
For people who read this post and what the solution.
Bellow the SQL request :
For Purchase Order
UPDATE `tabPurchase Order` SET `status` = 'Completed’, `per_billed` = 100, `per_received` = 100
WHERE `creation` < '2023-04-15' AND NOT `status` IN ('Closed', 'Cancelled', 'Completed');
For Purchase Receipt
UPDATE `tabPurchase Receipt` SET `status` = 'Completed', `per_billed` = 100
WHERE `creation` < '2023-04-15' AND NOT `status` = 'Cancelled';