Skip to content

Commit

Permalink
Merge branch 'pu/cw/eInvoiceLegacy' into '2024.11'
Browse files Browse the repository at this point in the history
tweak(Sales) add eInvoice ref fields to contracts

See merge request tine20/tine20!6350
  • Loading branch information
corneliusweiss committed Dec 10, 2024
2 parents 86a467a + 2444667 commit b7b1efa
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
30 changes: 28 additions & 2 deletions tine20/Sales/Model/Contract.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class Sales_Model_Contract extends Tinebase_Record_Abstract
*
*/
const RELATION_TYPE_RESPONSIBLE = 'RESPONSIBLE';


public const FLD_BUYER_REFERENCE = 'buyer_reference'; // varchar 255
public const FLD_PURCHASE_ORDER_REFERENCE = 'purchase_order_reference';
public const FLD_PROJECT_REFERENCE = 'project_reference';

/**
* holds the configuration object (must be declared in the concrete class)
*
Expand All @@ -45,7 +49,7 @@ class Sales_Model_Contract extends Tinebase_Record_Abstract
* @var array
*/
protected static $_modelConfiguration = array(
self::VERSION => 11,
self::VERSION => 12,
'recordName' => 'Contract', // gettext('GENDER_Contract')
'recordsName' => 'Contracts', // ngettext('Contract', 'Contracts', n)
'hasRelations' => TRUE,
Expand Down Expand Up @@ -214,6 +218,28 @@ class Sales_Model_Contract extends Tinebase_Record_Abstract
)
)
),
self::FLD_BUYER_REFERENCE => [
self::LABEL => 'Buyer Reference', //_('Buyer Reference')
self::TYPE => self::TYPE_STRING,
self::LENGTH => 255,
self::NULLABLE => true,
self::QUERY_FILTER => true,
self::SHY => true,
],
self::FLD_PURCHASE_ORDER_REFERENCE => [
self::LABEL => 'Purchase Order Reference', // _('Purchase Order Reference')
self::TYPE => self::TYPE_STRING,
self::LENGTH => 255,
self::NULLABLE => true,
self::QUERY_FILTER => true,
],
self::FLD_PROJECT_REFERENCE => [
self::LABEL => 'Project Reference', // _('Project Reference')
self::TYPE => self::TYPE_STRING,
self::LENGTH => 255,
self::NULLABLE => true,
self::QUERY_FILTER => true,
],
'contact_external' => array(
'type' => 'virtual',
'config' => array(
Expand Down
1 change: 1 addition & 0 deletions tine20/Sales/Setup/Update/17.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ public function update028(): void
{
Setup_SchemaTool::updateSchema([
Sales_Model_Invoice::class,
Sales_Model_Contract::class,
]);

$this->addApplicationUpdate(Sales_Config::APP_NAME, '17.28', self::RELEASE017_UPDATE028);
Expand Down
6 changes: 5 additions & 1 deletion tine20/Sales/js/ContractEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@ Tine.Sales.ContractEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
modelUnique: true,
ref: '../../../../../customerPicker',
fieldLabel: this.app.i18n._('Customer')
}], [ Tine.widgets.form.RecordPickerManager.get('Sales', 'Address', {
}], [
this.fieldManager('buyer_reference', { columnWidth: 0.5 }),
this.fieldManager('purchase_order_reference', { columnWidth: 0.25 }),
this.fieldManager('project_reference', { columnWidth: 0.25 })
], [ Tine.widgets.form.RecordPickerManager.get('Sales', 'Address', {
fieldLabel: this.app.i18n._('Billing Address'),
name: 'billing_address_id',
ref: '../../../../../addressPicker',
Expand Down

0 comments on commit b7b1efa

Please sign in to comment.