231801_test_to_master #1519
|
@ -543,7 +543,8 @@ INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`
|
|||
VALUES
|
||||
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
||||
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
||||
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
|
||||
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
|
||||
(1381, 'Ornamentales', 'Ornamentales', 7185000440, 1, '03815934E', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
|
||||
|
||||
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
|
||||
VALUES
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
margin-right: 2cm;
|
||||
font-size: 10px;
|
||||
color: #555;
|
||||
width: 100%;
|
||||
zoom: 0.65
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
<div class="centerText" v-if="centerText" class="uppercase">{{centerText}}</div>
|
||||
<div class="pageCount" v-html="$t('numPages')"></div>
|
||||
</div>
|
||||
<p class="privacy" v-html="$t('law.privacy')"></p>
|
||||
<p
|
||||
v-if="companyGroup == 'verdnatura'"
|
||||
v-html="$t('law.privacy')"
|
||||
class="privacy"
|
||||
/></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,60 @@
|
|||
const db = require('../../database');
|
||||
|
||||
module.exports = {
|
||||
name: 'report-footer',
|
||||
props: ['leftText', 'centerText']
|
||||
async serverPrefetch() {
|
||||
const companyCode = this.companyCode || 'VNL';
|
||||
|
||||
this.company = await this.getCompany(companyCode);
|
||||
this.fiscalAddress = await this.getFiscalAddress(companyCode);
|
||||
},
|
||||
computed: {
|
||||
companyName() {
|
||||
if (this.company.name)
|
||||
return this.company.name.toUpperCase();
|
||||
|
||||
return;
|
||||
},
|
||||
companyGroup() {
|
||||
if (this.company.groupName)
|
||||
return this.company.groupName.toLowerCase();
|
||||
|
||||
return;
|
||||
},
|
||||
companyPhone() {
|
||||
if (!this.company.phone) return;
|
||||
|
||||
let phone = this.company.phone;
|
||||
|
||||
if (phone.length >= 13) {
|
||||
const prefix = parseInt(phone.substr(0, 4));
|
||||
const number = phone.substr(5, phone.length);
|
||||
return `+${prefix} ${number}`;
|
||||
} else
|
||||
return phone;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCompany(code) {
|
||||
return db.findOne(`
|
||||
SELECT
|
||||
s.name,
|
||||
s.street,
|
||||
s.postCode,
|
||||
s.city,
|
||||
s.phone,
|
||||
cg.code AS groupName
|
||||
FROM company c
|
||||
JOIN companyGroup cg ON cg.id = c.companyGroupFk
|
||||
JOIN supplier s ON s.id = c.id
|
||||
WHERE c.code = ?`, [code]);
|
||||
},
|
||||
getFiscalAddress(code) {
|
||||
return db.findOne(`
|
||||
SELECT nif, register FROM company c
|
||||
JOIN supplier s ON s.id = c.id
|
||||
WHERE c.code = ?`, [code]);
|
||||
}
|
||||
},
|
||||
props: ['leftText', 'companyCode', 'centerText']
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{{companyName}}. {{company.street}}.
|
||||
{{company.postCode}} {{company.city}}.
|
||||
☎ {{companyPhone}}
|
||||
· {{$t('company.contactData')}}
|
||||
· <span v-if="companyGroup == 'verdnatura'" >verdnatura.es -</span> {{company.email}}
|
||||
</section>
|
||||
<section>CIF: {{fiscalAddress.nif}} {{fiscalAddress.register}}</section>
|
||||
</header>
|
||||
|
|
|
@ -43,7 +43,8 @@ module.exports = {
|
|||
s.postCode,
|
||||
s.city,
|
||||
s.phone,
|
||||
cg.code AS groupName
|
||||
cg.code AS groupName,
|
||||
c.email
|
||||
FROM company c
|
||||
JOIN companyGroup cg ON cg.id = c.companyGroupFk
|
||||
JOIN supplier s ON s.id = c.id
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="columns vn-mt-xl" v-if="invoice.payMethodCode == 'wireTransfer'">
|
||||
<div class="columns vn-mt-xl" v-if="invoice.payMethodCode == 'wireTransfer' && invoice.iban">
|
||||
<div class="size50 pull-left no-page-break">
|
||||
<div class="panel">
|
||||
<div class="header">{{$t('observations')}}</div>
|
||||
|
|
|
@ -11,7 +11,12 @@ module.exports = {
|
|||
this.client = await this.findOneFromDef('client', [this.reference]);
|
||||
this.taxes = await this.rawSqlFromDef(`taxes`, [this.reference]);
|
||||
this.hasIntrastat = await this.findValueFromDef(`hasIntrastat`, [this.reference]);
|
||||
this.intrastat = await this.rawSqlFromDef(`intrastat`, [this.reference, this.reference, this.reference, this.reference]);
|
||||
this.intrastat = await this.rawSqlFromDef(`intrastat`, [
|
||||
this.reference,
|
||||
this.reference,
|
||||
this.reference,
|
||||
this.reference
|
||||
]);
|
||||
this.rectified = await this.rawSqlFromDef(`rectified`, [this.reference]);
|
||||
this.hasIncoterms = await this.findValueFromDef(`hasIncoterms`, [this.reference]);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ FROM invoiceOut io
|
|||
JOIN client c ON c.id = io.clientFk
|
||||
JOIN payMethod pm ON pm.id = c.payMethodFk
|
||||
JOIN company cny ON cny.id = io.companyFk
|
||||
JOIN supplierAccount sa ON sa.id = cny.supplierAccountFk
|
||||
LEFT JOIN supplierAccount sa ON sa.id = cny.supplierAccountFk
|
||||
LEFT JOIN invoiceOutSerial ios ON ios.code = io.serial
|
||||
LEFT JOIN ticket t ON t.refFk = io.ref
|
||||
WHERE t.refFk = ?
|
Loading…
Reference in New Issue